Unlock instant, AI-driven research and patent intelligence for your innovation.

Resource acquisition method and terminal

A technology for acquiring methods and resources, applied in the field of resource management, can solve the problems of reduced business processing efficiency, returned abnormal information, and increased invalid requests, and achieves the effects of improving security and robustness, improving efficiency, and reducing invalid requests.

Active Publication Date: 2021-10-22
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF8 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, all interfaces on the server side need to provide concurrent access. In a concurrent scenario, when an interface calls and locks a resource, when other interfaces are called again, the resource cannot be obtained again because the resource is locked and an exception message is returned.
However, due to the locking of downstream resources, the upstream system cannot know, and in this scenario, the upstream service will continue to call the downstream interface, which will lead to an increase in invalid requests and a decrease in business processing efficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Resource acquisition method and terminal
  • Resource acquisition method and terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0055] Please refer to figure 1 , a resource acquisition method, including steps:

[0056] S1. Receive a resource acquisition request sent by an upstream node.

[0057] Specifically, in this embodiment, the upstream node includes the client, and when all resource acquisition requests sent by the client are normally in order, the resource acquisition request sent by the client normally arrives at the public platform gateway, and the public platform gateway sends a request to the resource The distribution system requests to obtain the resource interface, and after the request is made to obtain the resource interface, the resource is pre-locked inside the interface.

[0058] S2. If the resource to be acquired corresponding to the resource acquisition request is locked, determine whether the number of all resource acquisition requests reaches the threshold, and if so, return a special exception identifier to the upstream node, and according to the special exception The identific...

Embodiment 2

[0073] The difference between this embodiment and Embodiment 1 is that it further defines how to acquire resources when the locked resources to be acquired are unlocked or the number of all resource acquisition requests does not reach the threshold, specifically:

[0074] If the locked resource to be acquired is unlocked or the number of all resource acquisition requests does not reach the threshold, notify the upstream node to unlock the request for the resource to be acquired, and delete all resources related to the resource in the public cluster. Describes the lock information corresponding to the resource to be acquired.

[0075] In this embodiment, when the downstream node has been unlocked or the downstream node is still locked, but the request to wait for the locked resource is within a certain value, the upstream node can be notified of the unlocked resource, and the subsequent upstream node will delete the resource. The switch settings in the local memory continue to ...

Embodiment 3

[0077] Please refer to figure 2 , a resource acquisition terminal, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the resource of Embodiment 1 or Embodiment 2 when executing the computer program Get the steps of the method.

[0078] To sum up, a resource acquisition method and a terminal provided by the present invention receive a resource acquisition request sent by an upstream node, and if the resource to be acquired has been locked, judge whether the number of all resource acquisition requests reaches a threshold, and if it reaches the threshold, then Return the special exception identifier to the upstream node. The upstream node requests locking according to the special exception identifier, and synchronizes the lock information of the resource to be acquired to the public cluster. The upstream node that requests the lock obtains the lock information of the resource to be acquired by...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a resource acquisition method and a terminal. The method comprises the following steps: receiving a resource acquisition request sent by an upstream node; if the to-be-acquired resource is locked, judging whether the number of all resource acquisition requests reaches a threshold value or not; if the threshold value is reached, returning the special exception identifier is to the upstream node, wherein the upstream node performs request locking according to the special exception identifier; synchronizing the lock information of the resource to be acquired to the public cluster, and acquiring, by the upstream node requesting locking, the lock information of the resource to be acquired by querying the public cluster; therefore, when the to-be-acquired resource is locked and the number of the requests reaches the threshold value, the requests of the upstream node are locked, invalid requests of the upstream node can be reduced, the security and robustness of the system are improved, and the resource acquisition efficiency is improved.

Description

technical field [0001] The present invention relates to the technical field of resource management, in particular to a resource acquisition method and a terminal. Background technique [0002] In the current distributed system, there are many resource sharing situations. For example, a shared memory resource is only allowed to be accessed by one thread at a time. In order to realize this access mechanism, the mechanism usually used now is to lock the resource, such as an interface provided by the server, which internally accesses a shared memory resource, because the interface of the server provides concurrent For access, in order to ensure that only one thread accesses the memory resource at the same time, the interface method internally locks the modules that access the shared resource, that is, each time the lock needs to be acquired first, and the shared resource is only allowed to be accessed after the lock is successfully acquired . [0003] However, the interfaces o...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/52
CPCG06F9/52
Inventor 刘德建林伟陈宏
Owner FUJIAN TIANQUAN EDUCATION TECH LTD