Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Shared resource access processing method and device, electronic equipment and storage medium

A technology of sharing resources and processing methods, applied in the field of access processing methods of shared resources, electronic equipment and storage media, and devices, which can solve problems such as inability to meet users' access requirements for shared resources and cannot be realized

Pending Publication Date: 2021-09-07
MIDEA GRP CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Locks can be regarded as a thread synchronization mechanism for accessing shared resources under multi-threaded conditions. For single-process applications, all threads are in the same JVM (Java Virtual Machine, Java Virtual Machine) process, using the Java language provided The lock mechanism can control the shared resources synchronously; in a distributed environment, when multiple different threads need to access the shared resources synchronously, it cannot be achieved with the Java lock mechanism.
[0003] The existing technology mainly uses the optimistic lock of the database to realize the access control of shared resources. However, for scenarios with a large amount of instantaneous concurrency in a distributed environment, such as the access to shared resources in the Internet of Things, if only optimistic locks are used, it is often unable to satisfy users. Access requirements for shared resources

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
  • Shared resource access processing method and device, electronic equipment and storage medium
  • Shared resource access processing method and device, electronic equipment and storage medium
  • Shared resource access processing method and device, electronic equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0048] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The following examples are for more clearly explaining the technical solutions of the present invention without limiting the scope of the invention.

[0049] figure 1 A flow diagram of the access processing method of a shared resource provided in this embodiment is shown, including:

[0050] S101, determine the target thread to get a distributed lock access shared resource, and create an asynchronous compensation thread for the target thread.

[0051] Where the target thread is the thread that the current request access to the shared resource.

[0052] Shared resources are required for multiple threads, such as databases.

[0053] Distributed locks to control a way to access shared resources between distributed systems. In a distributed system, if a different system or a set of resources is shared between different hosts of the same system, when accessing these resources, mutual exclusion is often required to prevent interf...

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 relates to the field of Internet, and provides a shared resource access processing method and device, electronic equipment and a storage medium. The method comprises the steps that it is determined that a target thread obtains a distributed lock accessing shared resources, an asynchronous compensation thread is created for the target thread, and the asynchronous compensation thread is used for compensating for the time when the target thread occupies the distributed lock; and when determining that the time of occupying the distributed lock by the target thread is greater than a preset time period, the distributed lock is released. The asynchronous compensation thread is created for the target thread, so that midway release of the distributed lock caused by too long execution time of the target thread is avoided; meanwhile, by setting a preset time period, it is avoided that after the target thread is abnormal, the time for occupying the distributed lock is too long, and access of other threads to the shared resources is affected; and the distributed lock is released immediately when the thread occupies too long time or is terminated, so that the safety access efficiency of shared resources with large instantaneous concurrency in a distributed environment is improved.

Description

Technical field [0001] The present invention relates to the field of Internet technologies, in particular to access processing methods, devices, electronic devices, and storage media that share resources. Background technique [0002] With the development of the Internet, there is more and more access to shared resources, so you need to achieve access control of shared resources by locking. The lock can be seen as a thread synchronization mechanism for accessing the shared resource in the case, and all threads are provided in the same JVM (Java Virtual Machine, Java Virtual Machine). The lock mechanism can synchronize the shared resource; in the distributed environment, multiple different threads need to be synchronized with Java, which cannot be implemented with Java when the shared resource is synchronously. [0003] The prior art is mainly accessed by the shared resource by using the optimistic lock of the database, but for the instantaneous and launched scenarios, such as Int...

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
IPC IPC(8): G06F9/50G06F9/52
CPCG06F9/52G06F9/5022
Inventor 宋扬
Owner MIDEA GRP CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products