Disclosure of Invention
In order to solve the problem that a sharing mode and a unified management means for digital assets are lacked in an enterprise digital scene, the application provides a resource dynamic cooperation method, a device, a server and a medium.
In a first aspect, the present application provides a resource dynamic coordination method, which adopts the following technical scheme:
a resource dynamic cooperation method is applied among a first terminal, a second terminal and a management platform, and comprises the following steps:
acquiring attribute information of the first terminal, generating a unique identification code of the first terminal according to the attribute information of the first terminal, creating a receipt message queue according to the unique identification code of the first terminal, and sending the receipt message queue to the management platform, wherein the attribute information of the first terminal comprises the name of the first terminal;
creating a message queue according to the resource type to be registered of the first terminal on the management platform, and acquiring creation parameters of the message queue, wherein the creation parameters of the message queue comprise a queue name, a queue IP address, a queue port address, a queue user name and a queue password;
according to the creation parameters of the message queue, the management platform is automatically connected with the first terminal through the message queue, and the first terminal performs resource registration on the management platform through the message queue;
acquiring configuration information of the second terminal, configuring the configuration information to the management platform, wherein the configuration information of the second terminal comprises a server IP address, a port address, a first access key and a first access key, creating a first communication link between the second terminal and the management platform according to the configuration information of the second terminal, and the second terminal accesses the management platform through the first communication link.
By adopting the technical scheme, the message queue is created according to the resource type to be registered, the creation parameter of the message queue is obtained, the management platform can be automatically connected with the first terminal through the message queue according to the creation parameter, so that the first terminal registers corresponding resource information on the management platform to share the resource information of the first terminal to the management platform, the resource information can be uniformly managed through the management platform, the configuration information of the second terminal is configured on the management platform, the first communication link between the second terminal and the management platform is created according to the configuration information of the second terminal, the second terminal can access the management platform through the first communication link, the resource information stored in the management platform can be called and used through the second terminal, and therefore, under the enterprise digital scene, a resource sharing mode and a uniform management means are increased.
Optionally, the method further includes:
and acquiring a callback api address of the first terminal, sending the callback api address to the management platform, and calling back the resource on the management platform by the first terminal through the callback api address.
By adopting the technical scheme, the callback api address of the first terminal is obtained, and is sent to the management platform, so that the first terminal can call back resources from the management platform through the callback api address, and when the first terminal needs to manage some resources stored on the management platform, the first terminal can call back from the management platform conveniently and quickly.
Optionally, if the first terminal successfully registers the resource through the message queue, the management platform feeds back the information of successful resource registration to the first terminal through the receipt message queue.
By adopting the technical scheme, when the first terminal successfully registers the resource on the management platform through the message queue, the management platform can feed back the information of successful resource registration to the first terminal through the receipt message queue, so as to conveniently inform the first terminal that the resource registration is successful.
Optionally, if the management platform changes or modifies the registered resource, the management platform feeds back the changed or modified resource to the first terminal through the receipt message queue.
By adopting the technical scheme, when the management platform changes or modifies the registered resources, the management platform can feed back the changed or modified resources to the first terminal through the receipt message queue, so that the first terminal is conveniently informed that the resources of the first terminal are changed or modified through the changed or modified resources.
Optionally, the method for creating a response piece message queue specifically includes:
creating a switch with the unique identification code of the exchange + the first terminal as a name according to a preset rule;
creating a message queue with the unique identification code of the queue + the first terminal as a name according to a preset rule;
and performing association binding on the message queue of the queue + the unique identification code of the first terminal and the exchange of the exchange + the unique identification code of the first terminal, and automatically generating the receipt message queue.
By adopting the technical scheme, the exchanger taking the unique identification code of the exchange + the first terminal as the name and the message queue taking the unique identification code of the queue + the first terminal as the name are respectively created according to the preset rule, and the message queue and the exchanger are associated and bound to generate the receipt message queue, so that the uniqueness of the receipt message queue can be improved.
Optionally, the method further includes:
and the management platform randomly generates and stores a group of second access keys and second access keys according to the second terminal, and sends the second access keys and the second access keys to the second terminal, if the first access key is consistent with the second access key and the first access key is consistent with the second access key, a second communication link between the second terminal and the management platform is established, and the management platform accesses the second terminal through the second communication link.
By adopting the technical scheme, according to the second terminal, the management platform randomly generates a group of second access keys and second access keys, stores the second access keys and the second access keys, then sends the generated second access keys and the second access keys to the second terminal, authenticates and verifies the second access keys and the second access keys, and if the second access keys are consistent with the first access keys and the second access keys are consistent with the first access keys, a second communication link between the second terminal and the management platform is established, so that the management platform can access the second terminal through the second communication link, thereby performing two-way communication between the second terminal and the management platform through the first communication link and facilitating the communication of resource information between the second terminal and the management platform.
In a second aspect, the present application provides a resource dynamic coordination apparatus, which adopts the following technical solution:
a resource dynamic coordination apparatus, comprising:
the system comprises a first establishing and obtaining module, a first management module and a second establishing and obtaining module, wherein the first establishing and obtaining module is used for obtaining attribute information of a first terminal, generating a unique identification code of the first terminal according to the attribute information of the first terminal, establishing a receipt message queue according to the unique identification code of the first terminal, and sending the receipt message queue to a management platform, and the attribute information of the first terminal comprises a name of the first terminal;
a second creation and acquisition module, configured to create a message queue according to a resource type that needs to be registered on the management platform by the first terminal, and acquire creation parameters of the message queue, where the creation parameters of the message queue include a queue name, a queue IP address, a queue port address, a queue user name, and a queue password;
the resource registration module is used for automatically connecting the management platform with the first terminal through the message queue according to the creation parameters of the message queue, and the first terminal performs resource registration on the management platform through the message queue;
a third creating and acquiring module, configured to acquire configuration information of a second terminal, and configure the configuration information on the management platform, where the configuration information of the second terminal includes a server IP address, a port address, a first access key, and according to the configuration information of the second terminal, a first communication link between the second terminal and the management platform is created, and the second terminal accesses the management platform through the first communication link.
By adopting the technical scheme, the message queue is created according to the resource type to be registered, the creation parameter of the message queue is obtained, the management platform can be automatically connected with the first terminal through the message queue according to the creation parameter, so that the first terminal registers corresponding resource information on the management platform to share the resource information of the first terminal to the management platform, the resource information can be uniformly managed through the management platform, the configuration information of the second terminal is configured on the management platform, the first communication link between the second terminal and the management platform is created according to the configuration information of the second terminal, the second terminal can access the management platform through the first communication link, the resource information stored in the management platform can be called and used through the second terminal, and therefore, under the enterprise digital scene, a resource sharing mode and a uniform management means are increased.
Optionally, the method further includes:
and the generation authentication module is used for randomly generating and storing a group of second access keys and second access keys by the management platform according to the second terminal, sending the second access keys and the second access keys to the second terminal, and if the second access keys are consistent with the first access keys and the second access keys are consistent with the first access keys, establishing a second communication link between the second terminal and the management platform, and accessing the second terminal by the management platform through the second communication link.
By adopting the technical scheme, according to the second terminal, the management platform randomly generates a group of second access keys and second access keys, stores the second access keys and the second access keys, then sends the generated second access keys and the second access keys to the second terminal, authenticates and verifies the second access keys and the second access keys, and if the second access keys are consistent with the first access keys and the second access keys are consistent with the first access keys, a second communication link between the second terminal and the management platform is established, so that the management platform can access the second terminal through the second communication link, thereby performing two-way communication between the second terminal and the management platform through the first communication link and facilitating the communication of resource information between the second terminal and the management platform.
In a third aspect, the present application provides a server, which adopts the following technical solution:
a server comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, the processor when loaded with the computer program performing the method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, having stored thereon a computer program which, when loaded by a processor, performs the method of the first aspect.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to fig. 1-6 and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The resource dynamic cooperation method and device are mainly applied among a subsystem, a management platform and a partner, wherein the subsystem is a first terminal, the management platform is a management platform, the partner is a second terminal, and the subsystem generally refers to a subsystem of an enterprise; in the process of digital transformation, enterprises often generate a lot of subsystems and a lot of digital assets, however, the subsystems inside the enterprises lack a sharing mode for the digital assets, the enterprises lack a unified management means for the digital assets, and a convenient way for the enterprises of the partners to share the digital assets is lacked.
According to the resource dynamic cooperation method and device, the subsystem is supported to conduct information registration and resource cooperation, various types of digital assets are supported to conduct registration and management, and the partner can achieve rapid butt joint and sharing of the digital assets. The resource dynamic cooperation method is mainly divided into a system management part, a local domain cooperation part and a cross-domain cooperation part. The method has the advantages that the spring closed Alibaba micro-service distributed framework is used for development and deployment in the modes of high availability, high expansion and service, and the problems of service performance bottleneck, small service capacity and the like are solved on the basis of the framework. And as a central system, high availability is particularly important, and on the basis of the development principle of service, the management platform also constructs services by taking modules as units, so that service expansion can be rapidly and accurately carried out in various sudden scenes of enterprises.
Besides being compatible with each subsystem in the api form for resource registration, the method also supports the safety information exchange across networks on the cloud in the form of RabbitMQ message queues. After the subsystem is authenticated and registered, the management platform allocates independent switches and message channels for the subsystem, then the subsystem can create message channels with different resource types to complete the construction and intercommunication of information channels, and then the subsystem can perform callback monitoring of resources from the management platform, thereby completing the bidirectional communication of resources and comprehensively opening the 'conception and supervision' of resource coordination.
The subsystem can register api, data, light application, model and other types of digital resources in the management platform, dynamic monitoring of the resources is constructed based on a Canal framework, and the Canal is an incremental log analysis based on a database and provides a framework for subscription and consumption of incremental data. When a large amount of resources are registered in the management platform, the dynamic monitoring of the resources is very important. Resource monitoring also becomes particularly difficult when resources are registered on the management platform from multiple channels. If the management platform must perform data monitoring in different channels, a large amount of thread resources are consumed to perform individual monitoring, and monitoring is easily lost. If the Canal is used for monitoring middleware, the problem of resource monitoring can be solved from the root of the problem. When the resources change, the Canal monitors the data change from the aspect of the database, the management platform reports the resource change situation to the management platform in real time only by ensuring the connection of the Canal service, and the management platform can exchange resource information with the subsystem in real time, so that the dynamic resource cooperative operation is completed.
The method comprises the steps that a partner is a basic unit for digital asset sharing of an enterprise, when the partner needs to use digital assets, authentication and safe registration are carried out on a management platform, and then the management platform can open cross-domain resources to exchange the digital assets.
Referring to fig. 1, an embodiment of the present application discloses a resource dynamic cooperation method, which specifically includes the following steps:
s1: acquiring attribute information of the subsystem, generating a unique identification code of the subsystem according to the attribute information of the subsystem, creating a receipt message queue according to the unique identification code of the subsystem, and sending the receipt message queue to a management platform, wherein the attribute information of the subsystem comprises the name of the subsystem.
Referring to fig. 2, in this step, the method for creating a response piece message queue specifically includes:
s11: creating a switch with the unique identification code of the exchange + subsystem as a name according to a preset rule;
s12: establishing a message queue taking the unique identification code of the queue + subsystem as a name according to a preset rule;
s13: and (3) performing association binding on the message queue of the unique identification code of the queue + subsystem and the switch of the unique identification code of the exchange + subsystem, and automatically generating a receipt message queue.
Specifically, the preset rule specifically includes:
a field template for registering the resource is provided, and then the resource type is configured on the collaboration center.
After the resource type configuration is completed, a message queue of a specified resource type is created in the message queue, information of 'switch' and 'subject' is provided, and subsequent resources need to be issued to the specified queue.
The resource transmission format is a "list" object, if only one object needs to be packaged by using the "list", and specifically, the parameters which must be carried in each object include a parameter name, a parameter type, whether the parameter is required and a parameter description. Specific examples are as follows:
parameter name | parameter type | whether or not a parameter is required | parameter description |)
| sourceId | String | true | origin message ID (each resource object needs to be carried, uniqueness) | gaming
I resource id String fault insertion operation is not transmitted, update/delete must transmit
The deleted Boolean false operation is not transmitted when deleted, is transmitted when deleted, and has the value of true
| name | String | true | resource name |)
Cooperative range strand true collaboration range (1: local 2: cross-domain 3: global) range.
After the designated message queue is created, a message queue of 'queue + unique identifier of subsystem' is generated at the same time, and the subsystem needs to monitor the message queue and then push the binding relationship of 'message ID and resource ID' to the message queue.
In specific implementation, for example, if the resource registered by the subsystem on the management platform is a model resource, the method specifically includes:
first, the field configuration of the model resource is provided as follows:
| field name | field remark | data type | data length |)
| file _ addr | model file address | text |1024| non-computing
| come | model use description | varchar |256| non-conducting air
The parameter | param _ config | configures | text |2056|.
After the cooperative hub is configured with the resource, the cooperative hub allocates message channel information to provide for a subsystem to register resources (one resource is configured once, and subsequent same resource types are all pushed to the queue), the subsystem register resources only need to push the register resources to the message queue provided in the previous step, and meanwhile, a message queue of 'queue + unique identifier of the subsystem' needs to be monitored, and the binding relationship of 'message ID and resource ID' is received.
The receipt message queue is sent to the management platform, and then the management platform can be connected with the receipt message queue configured by the upper subsystem, so that the corresponding receipt message queue service is connected.
The attribute of the subsystem includes a name of the subsystem, specifically, some description of the subsystem, for example, a certain terminal, a certain platform, and the like.
Referring to fig. 3, S2: and creating a message queue according to the resource type which needs to be registered on the management platform by the subsystem, and acquiring the creation parameters of the message queue, wherein the creation parameters of the message queue comprise a queue name, a queue IP address, a queue port address, a queue user name and a queue password.
In this step, the resource types may include api resources, data resources, model resources, light application resources, and the like.
Specifically, the api resource specifically includes an api address, a request type, a request parameter configuration, a response type, a response parameter configuration, the department ID, request header information, a relevant description, and the like.
Specifically, the data resource specifically includes a database type, a database driver type, a host address, a connection port address, a database name, a user name, a password, a table name, field information, a belonging department, a table Chinese name, creation time, update time, a related description, and the like.
Specifically, the model resources specifically include a model file address, a model use introduction, parameter configuration, a relevant description, and the like.
Specifically, the light application resource includes a name, an application type, a related description, a version, a creation time, an application picture URL, a publisher and application access URL, and the like.
S3: according to the creating parameters of the message queue, the management platform is automatically connected with the subsystem through the message queue, and the subsystem performs resource registration on the management platform through the message queue.
In this step, if the subsystem successfully registers the resource through the message queue, the management platform feeds back the information of successful resource registration to the subsystem through the receipt message queue to inform the subsystem of successful resource registration.
When the subsystem needs to call back resources from the management platform, the method specifically includes: acquiring a callback api address of the subsystem, and sending the callback api address to the management platform, and then calling back resources on the management platform by the subsystem through the callback api address; therefore, a two-way communication relation is established between the subsystem and the management platform, namely the subsystem can register resources on the management platform through the message queue, and can call back the required resources from the management platform through the callback api address, namely, the subsystem can register the resources and call back the resources on the management platform, and the management platform can also access the subsystem.
The two-way communication relation is established between the subsystem and the management platform, so that the subsystem can register resources on the management platform, and the problem that the subsystem of an enterprise lacks a resource sharing means can be solved; meanwhile, the registered resources can be uniformly managed through the management platform, so that the problem that an enterprise lacks a uniform management means for the resources can be solved.
The management platform can browse and modify the existing resources through a Web interface, and can also change the resource information in a message queue or api mode; furthermore, if the management platform changes or modifies the registered resources, the management platform feeds back the changed or modified resources to the subsystem through the receipt message queue to inform the subsystem.
In specific implementation, the subsystem registers resources on the management platform through the message queue, after the resources are registered successfully, the message queue returns the unique identification code of the resources, the subsystem can transmit the unique identification code of the resources and the receipt interface parameters to the management platform through the resource use api to perform resource use statement, and if the resource information is changed or modified, a resource information change or modification notice is sent to the subsystem through the receipt message queue.
S4: the method comprises the steps of obtaining configuration information of a partner and configuring the configuration information on a management platform, wherein the configuration information of the partner comprises a server IP address, a port address, a first access key (Access Key) and a first access key (Access secret), a first communication link between the partner and the management platform is established according to the configuration information of the partner, and the partner accesses the management platform through the first communication link.
Referring to fig. 4 and 5, specifically, in this step, the partner configures the configuration information on the management platform, and then the management platform authenticates and verifies the configuration information, and if the authentication passes, a first communication link is created according to the configuration information, so that the partner can access the management platform through the first communication link, that is, the partner can view a cross-domain resource list on the management platform to browse and screen resources, and then the partner can apply for using cross-domain resources on the management platform, and the administrator can apply for using cross-domain resources to perform operations such as approval and approval rejection through the management platform, and if the administrator performs approval operation, the partner can invoke resources on the management platform; on the contrary, if the administrator makes an operation of approval rejection, the partner cannot call the resource on the management platform. Wherein, this method can also include:
s5: the management platform randomly generates and stores a group of second access keys (access keys) and second access keys (access secret) according to the cooperation party, sends the second access keys and the second access keys to the cooperation party, and if the second access keys are consistent with the first access keys and the second access keys are consistent with the first access keys, a second communication link between the cooperation party and the management platform is established, and the management platform accesses the cooperation party through the second communication link.
Referring to fig. 4, specifically, in this step, only when the management platform and the partner establish a communication relationship for the first time, the management platform randomly generates a set of the second access key and the second access key according to the partner, stores the second access key and the second access key, and directly performs authentication verification by using the generated second access key and the second access key when the management platform and the partner communicate next time.
In this step, if the second access key is consistent with the first access key and the second access key is consistent with the first access key, a second communication link may be created between the partner and the management platform, and the management platform may access the partner through the second communication link.
The management platform and the partner can exchange resource information through the two-way communication link by creating the two-way communication link (the first communication link and the second communication link) between the management platform and the partner; therefore, the problem that the management platform lacks resource sharing means for enterprises of the partner can be solved.
Referring to fig. 6, an embodiment of the present application discloses a resource dynamic cooperation apparatus, which specifically includes:
the first establishing and obtainingmodule 1 is used for obtaining attribute information of the subsystem, generating a unique identification code of the subsystem according to the attribute information of the subsystem, establishing a receipt message queue according to the unique identification code of the subsystem, and sending the receipt message queue to the management platform, wherein the attribute information of the subsystem comprises the name of the subsystem;
the second creation and acquisition module 2 is used for creating a message queue according to the resource type to be registered on the management platform by the subsystem and acquiring creation parameters of the message queue, wherein the creation parameters of the message queue comprise a queue name, a queue IP address, a queue port address, a queue user name and a queue password;
theresource registration module 3 is used for automatically connecting the management platform with the subsystem through the message queue according to the creation parameters of the message queue, and the subsystem performs resource registration on the management platform through the message queue;
the third creation and acquisition module 4 is used for acquiring configuration information of a partner and configuring the configuration information to the management platform, wherein the configuration information of the partner comprises a server IP address, a port address, a first access key and a first access key, a first communication link between the partner and the management platform is created according to the configuration information of the partner, and the partner accesses the management platform through the first communication link;
and the generation authentication module 5 is used for randomly generating and storing a group of second access keys and second access keys by the management platform according to the partner, sending the second access keys and the second access keys to the partner, if the second access keys are consistent with the first access keys and the second access keys are consistent with the first access keys, establishing a second communication link between the partner and the management platform, and accessing the partner by the management platform through the second communication link.
The application of the apparatus is consistent with that of the method of the above embodiment, and therefore, the detailed description thereof is omitted here.
The embodiment of the application discloses a server, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein when the processor loads the computer program, the resource dynamic cooperation method of the embodiment is executed.
The server may be a desktop computer, a notebook computer, or a cloud server, and the server includes but is not limited to a processor and a memory, for example, the server may further include an input/output device, a network access device, a bus, and the like.
The processor may be a Central Processing Unit (CPU), and of course, according to an actual use situation, other general processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like may also be used, and the general processor may be a microprocessor or any conventional processor, and the present application does not limit the present invention.
The storage may be an internal storage unit of the server, for example, a hard disk or a memory of the server, or an external storage device of the server, for example, a plug-in hard disk, a Smart Memory Card (SMC), a secure digital card (SD) or a flash memory card (FC) provided on the server, and the storage may also be a combination of the internal storage unit of the server and the external storage device, and the storage is used for storing a computer program and other programs and data required by the server, and the storage may also be used for temporarily storing data that has been output or will be output, which is not limited in this application.
The server stores the resource dynamic cooperation method of the embodiment in a memory of the server, and is loaded and executed on a processor of the server, so as to be convenient for a user to use.
The embodiment of the application discloses a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium, wherein when the computer program is loaded by a processor, the resource dynamic cooperation method of the embodiment is executed.
The computer program may be stored in a computer readable medium, the computer program includes computer program code, the computer program code may be in a source code form, an object code form, an executable file or some intermediate form, and the like, the computer readable medium includes any entity or device capable of carrying the computer program code, a recording medium, a usb disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read Only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunication signal, a software distribution medium, and the like, and the computer readable medium includes but is not limited to the above components.
The resource dynamic cooperation method of the above embodiment is stored in the computer-readable storage medium through the computer-readable storage medium, and is loaded and executed on the processor, so as to facilitate storage and application of the resource dynamic cooperation method.
The foregoing is a preferred embodiment of the present application and is not intended to limit the scope of the present application in any way, and any features disclosed in this specification (including the abstract and drawings) may be replaced by alternative features serving equivalent or similar purposes, unless expressly stated otherwise. That is, unless expressly stated otherwise, each feature is only an example of a generic series of equivalent or similar features.