CN112783660B - Resource processing method and device in virtual scene and electronic equipment - Google Patents
Resource processing method and device in virtual scene and electronic equipment Download PDFInfo
- Publication number
- CN112783660B CN112783660B CN202110170979.7A CN202110170979A CN112783660B CN 112783660 B CN112783660 B CN 112783660B CN 202110170979 A CN202110170979 A CN 202110170979A CN 112783660 B CN112783660 B CN 112783660B
- Authority
- CN
- China
- Prior art keywords
- resource
- attribute
- checked
- virtual scene
- resources
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title abstract description 12
- 230000002159 abnormal effect Effects 0.000 claims abstract description 168
- 238000012545 processing Methods 0.000 claims abstract description 146
- 238000007689 inspection Methods 0.000 claims abstract description 103
- 238000000034 method Methods 0.000 claims abstract description 64
- 238000013507 mapping Methods 0.000 claims abstract description 34
- 238000003860 storage Methods 0.000 claims abstract description 14
- 238000012216 screening Methods 0.000 claims description 46
- 230000015654 memory Effects 0.000 claims description 28
- 230000004044 response Effects 0.000 claims description 24
- 230000008439 repair process Effects 0.000 claims description 17
- 230000000875 corresponding effect Effects 0.000 description 166
- 239000000306 component Substances 0.000 description 20
- 238000010586 diagram Methods 0.000 description 20
- 230000006870 function Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 9
- 230000000694 effects Effects 0.000 description 8
- 238000001914 filtration Methods 0.000 description 8
- 230000007246 mechanism Effects 0.000 description 8
- 238000009877 rendering Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 238000010200 validation analysis Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 230000008447 perception Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 5
- 230000003993 interaction Effects 0.000 description 5
- 230000035807 sensation Effects 0.000 description 5
- 230000016776 visual perception Effects 0.000 description 5
- 238000012423 maintenance Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 238000013515 script Methods 0.000 description 4
- 230000001960 triggered effect Effects 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 3
- 239000000463 material Substances 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 239000002184 metal Substances 0.000 description 2
- 229910052751 metal Inorganic materials 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000001339 gustatory effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 150000002739 metals Chemical class 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000004083 survival effect Effects 0.000 description 1
- 208000015041 syndromic microphthalmia 10 Diseases 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application provides a resource processing method, a device, electronic equipment and a computer readable storage medium in a virtual scene; the method comprises the following steps: responding to the strategy setting operation received in the resource processing interface, and acquiring an inspection strategy set for the virtual scene; the checking strategy comprises a name of the attribute to be checked and an attribute value condition corresponding to the attribute to be checked; mapping the attribute to be checked of the resource in the virtual scene into a callable object according to the name of the attribute to be checked, and obtaining an attribute value of the resource corresponding to the attribute to be checked by calling the callable object corresponding to the attribute to be checked; matching the attribute value of the attribute to be checked corresponding to the resource with the attribute value condition corresponding to the attribute to be checked, and determining the abnormal resource in the virtual scene according to the obtained matching result; and updating the resource processing interface according to the abnormal resources. The application can reduce the realization cost of resource processing and simultaneously reduce the occupation of computing resources of the electronic equipment.
Description
Technical Field
The present application relates to computer technologies, and in particular, to a method and apparatus for processing resources in a virtual scene, an electronic device, and a computer readable storage medium.
Background
With the rapid development of computer technology, the channels for sensing environment and acquiring information are expanded, and virtual scenes are one typical example. The virtual scene refers to a scene which is output by the electronic equipment and is different from the real world, and a user can simulate the virtual scene to realize the perception of the real world so as to realize the interaction with the virtual scene.
Virtual scenes often include multiple resources, such as a map, animation, etc. In the development and operation process of the virtual scene, the attribute values of some resources in the virtual scene may be abnormal due to the reasons of incorrect setting of related personnel or version update of the virtual scene. In the scheme provided by the related art, a set of codes is generally written separately for each attribute to be checked to determine whether the attribute value is abnormal. But this approach is too costly to maintain for the code and can result in excessive occupation of computing resources of the electronic device.
Disclosure of Invention
The embodiment of the application provides a resource processing method, a device, electronic equipment and a computer readable storage medium in a virtual scene, which can improve the universality of different attributes to be checked, reduce the realization cost of resource processing and reduce the occupation of computing resources of the electronic equipment.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a resource processing method in a virtual scene, which comprises the following steps:
responding to the strategy setting operation received in the resource processing interface, and acquiring an inspection strategy set for the virtual scene; the inspection strategy comprises names of attributes to be inspected and attribute value conditions corresponding to the attributes to be inspected;
Mapping the attribute to be checked of the resource in the virtual scene into a callable object according to the name of the attribute to be checked, and obtaining an attribute value of the resource corresponding to the attribute to be checked by calling the callable object corresponding to the attribute to be checked;
Matching the attribute value of the attribute to be checked corresponding to the resource with the attribute value condition corresponding to the attribute to be checked, and determining the abnormal resource in the virtual scene according to the obtained matching result;
and updating the resource processing interface according to the abnormal resources.
The embodiment of the application provides a resource processing device in a virtual scene, which comprises the following components:
The acquisition module is used for responding to the strategy setting operation received in the resource processing interface and acquiring an inspection strategy set for the virtual scene; the inspection strategy comprises names of attributes to be inspected and attribute value conditions corresponding to the attributes to be inspected;
the mapping module is used for mapping the attribute to be checked of the resource in the virtual scene into a callable object according to the name of the attribute to be checked, and obtaining an attribute value of the attribute to be checked corresponding to the resource by calling the callable object corresponding to the attribute to be checked;
The matching module is used for carrying out matching processing on the attribute value of the attribute to be checked corresponding to the resource and the attribute value condition corresponding to the attribute to be checked, and determining abnormal resources in the virtual scene according to the obtained matching result;
and the updating module is used for updating the resource processing interface according to the abnormal resources.
An embodiment of the present application provides an electronic device, including:
A memory for storing executable instructions;
and the processor is used for realizing the resource processing method in the virtual scene when executing the executable instructions stored in the memory.
The embodiment of the application provides a computer readable storage medium which stores executable instructions for causing a processor to execute, thereby realizing the resource processing method in the virtual scene.
The embodiment of the application has the following beneficial effects:
According to the name of the attribute to be checked in the acquired checking strategy, the attribute to be checked of the resource is mapped into a callable object, the attribute value of the attribute to be checked is obtained by calling the callable object, and then the attribute value is checked according to the attribute value condition corresponding to the attribute to be checked in the checking strategy, so that the abnormal resource in the virtual scene is determined, intelligent resource processing can be realized only by setting the checking strategy, the universality of different attributes to be checked can be improved, the realization cost of the resource processing can be reduced, and the computing resource occupation of the electronic equipment in the resource processing process can be reduced.
Drawings
FIG. 1 is a schematic diagram of a resource handling scheme provided by the related art;
FIG. 2 is a schematic diagram of a resource processing system in a virtual scenario according to an embodiment of the present application;
fig. 3 is a schematic architecture diagram of a terminal device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a virtual scene engine provided by an embodiment of the present application;
Fig. 5A is a flowchart illustrating a method for processing resources in a virtual scenario according to an embodiment of the present application;
Fig. 5B is a flowchart illustrating a method for processing resources in a virtual scene according to an embodiment of the present application;
fig. 5C is a flowchart illustrating a method for processing resources in a virtual scene according to an embodiment of the present application;
Fig. 5D is a flowchart illustrating a method for processing resources in a virtual scene according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a resource handling interface provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a resource handling interface provided by an embodiment of the present application;
FIG. 8A is a schematic diagram of a resource handling interface provided by an embodiment of the present application;
FIG. 8B is a schematic diagram of a resource handling interface provided by an embodiment of the present application;
FIG. 9 is a schematic diagram of a resource configuration provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of a resource process provided by an embodiment of the present application;
FIG. 11 is a schematic diagram of an attribute check provided by an embodiment of the present application.
Detailed Description
The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", and the like are merely used to distinguish between similar objects and do not represent a particular ordering of the objects, it being understood that the "first", "second", or the like may be interchanged with one another, if permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein. In the following description, the term "plurality" refers to at least two.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
1) Virtual scene: the method has the advantages that a scene which is output by the electronic equipment and is different from the real world is utilized, visual perception of a virtual scene can be formed through naked eyes or the assistance of the equipment, for example, a two-dimensional image output by a display screen is utilized, and a three-dimensional image output by three-dimensional display technologies such as three-dimensional projection, virtual reality and augmented reality technologies is utilized; in addition, various simulated real world sensations such as auditory sensations, tactile sensations, olfactory sensations, and motion sensations can also be formed by various possible hardware. The virtual scene may be a simulation environment for the real world, a semi-simulation and semi-fictional virtual environment, or a pure fictional virtual environment. The virtual scene may be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene or a three-dimensional virtual scene, and the dimension of the virtual scene is not limited in the embodiment of the present application.
2) In response to: for representing a condition or state upon which an operation is performed, one or more operations performed may be in real-time or with a set delay when the condition or state upon which the operation is dependent is satisfied; without being specifically described, there is no limitation in the execution sequence of the plurality of operations performed.
3) The resource: the items of the virtual scene may include two parts of a virtual scene engine (such as a game engine) and a resource, wherein the virtual scene engine is a set of codes (instructions) designed for and recognized by an electronic device outputting the virtual scene, and is used for controlling how the resource in the virtual scene is output; and the resource is the content that needs to be output. The virtual scene often includes a plurality of resources, and the resource types in the virtual scene are not limited by the embodiments of the present application, for example, the resource types include, but are not limited to, a map (image), an animation, and a sound. In addition, the virtual scene may include a plurality of modules, each including a plurality of resources, and the modules may be divided according to the actual application scene, for example, in the game virtual scene, a plurality of modules such as characters, weapons, monsters, and the like may be divided.
It should be noted that, the resources in the virtual scenario generally refer to static resources, and the computing resources of the electronic device generally include central processing unit (Central Processing Unit, CPU) resources, memory resources, hard disk resources, and the like.
4) Attributes: refers to the intrinsic properties that a resource has, and is used to describe the resource. One resource often has multiple attributes, and can be configured in a self-defined manner according to an actual application scenario, for example, for a resource whose resource type is a map, the attributes may include a resource path, a resource name, an occupied memory, a height, and the like. In the embodiment of the application, resources with different resource types can correspond to the same attribute or can correspond to different attributes.
5) Resource processing interface: the method is used for receiving the related strategies set for the virtual scene, and can also be used for presenting abnormal resources to remind related personnel of repairing. The resource handling interfaces may include two classes, one class existing independent of the virtual scene, such as an independent Web interface; another type is an engine interface provided by a virtual scene engine, such as a user interface provided by an Editor (Editor) component in the virtual scene engine. In embodiments of the present application, either of these two types of interfaces may be optionally used, or a combination of these two types of interfaces may be used.
6) Strategy: also known as rules, the electronic device may parse the policy according to the set logic and perform corresponding operations to implement corresponding functions, e.g., the electronic device may perform operations to determine abnormal resources in the virtual scene according to the inspection policy. The policies may be set manually by the relevant personnel or automatically by artificial intelligence (ARTIFICIAL INTELLIGENCE, AI).
7) Reflection (Reflection): in the running state of the program, various components such as attributes, methods and parent classes in the class (such as Java class) can be mapped into corresponding objects, and the attributes and methods of the mapped objects are supported, so that the functions of dynamically acquiring program information and dynamically calling the objects are reflection mechanisms, and the reflection mechanisms are the keys of dynamic languages. In the embodiment of the application, the reflection can be performed based on the name of the attribute to be checked, so as to obtain the attribute value of the attribute to be checked.
It should be noted that, the Object (Object) is an abstraction of an objective Object, and the Class (Class) is an abstraction of an Object, and is an abstract data type. From another perspective, an object is an instance of a class, which is a template of the object. In the embodiment of the application, the class may refer to a class to which a resource in a virtual scene belongs, for example, corresponding classes may be defined for different resource types.
In the scheme provided by the related art, if an attribute to be checked needs to be newly added in the virtual scene, four steps of operations need to be executed. As shown in fig. 1, the first step is to manually write an acquisition code of an attribute to be inspected, the acquisition code being used to acquire an attribute value of the attribute to be inspected when being executed; secondly, manually setting attribute value conditions; the third step is to manually write a read code for the attribute value condition, the read code being for reading the attribute value condition when executed; the fourth step is to artificially write a check code for an attribute value condition for checking whether an attribute value of an attribute to be checked is abnormal when executed. Similarly, if the attribute value condition of a certain added attribute to be checked needs to be updated, similar four steps are performed.
The solution provided by the related art has at least the following problems: the four steps of operation are closely connected, the coupling degree between codes (such as the coupling degree between the code acquisition, the code reading and the code checking) is high, the problem easily occurs when the code needs to be updated each time, and the maintenance cost of the code is high; for each attribute to be checked, a corresponding set of codes (such as acquiring codes, reading codes and checking codes) needs to be independently written, so that the universality of different attributes to be checked and different virtual scenes is poor, meanwhile, more manpower cost is required to write the codes, and more computing resources are also consumed by the electronic equipment to store a large number of related codes.
The embodiment of the application provides a resource processing method, a device, an electronic device and a computer readable storage medium in a virtual scene, which can simplify the operation of resource processing, namely, the operation of a broken line frame part in fig. 1 (the third step to the fourth step) is not required to be executed, when an attribute to be checked is newly added, a method for acquiring an attribute value (for example, the name of the attribute to be checked is added) is only required to be added in a code, the dependency relationship between codes can be relieved, and the code maintenance cost when the attribute to be checked is newly added or the condition of updating the attribute value is reduced. An exemplary application of the electronic device provided by the embodiment of the present application is described below, where the electronic device provided by the embodiment of the present application may be implemented as various types of terminal devices, or may be implemented as a server.
Referring to fig. 2, fig. 2 is a schematic architecture diagram of a resource processing system 100 in a virtual scenario provided by an embodiment of the present application, where a terminal device 400 is connected to a server 200 through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two.
In some embodiments, taking an electronic device as an example of a terminal device, the method for processing resources in a virtual scene provided in the embodiments of the present application may be implemented by the terminal device, and is suitable for some practical application scenarios where computing power of the terminal device 400 is completely relied on to complete computing of relevant data and processing of resources of the virtual scene, for example, a game in a single-machine/offline mode completes output of the virtual scene through the terminal device 400.
As an example, as shown in fig. 2, the terminal device 400 runs the client 410, and the client 410 presents the resource processing interface 500 during the running process. The client 410 obtains a check policy set for the virtual scene in response to the policy setting operation received in the resource processing interface 500, and the check policy may be manually set by a related person (i.e., a user), or may be automatically set by invoking AI when the client 410 receives the policy setting operation.
The inspection policy includes a name of the attribute to be inspected and an attribute value condition corresponding to the attribute to be inspected, and the client 410 may map the attribute to be inspected of the resource in the virtual scene to a callable object according to the name of the attribute to be inspected, and obtain an attribute value of the attribute to be inspected corresponding to the resource by calling the callable object corresponding to the attribute to be inspected, where the process corresponds to the reflection mechanism above. Then, the client 410 performs matching processing on the attribute value of the attribute to be checked corresponding to the resource and the attribute value condition corresponding to the attribute to be checked, and determines an abnormal resource in the virtual scene according to the obtained matching result. Finally, the client 410 updates the resource processing interface 500 according to the abnormal resources, as shown in fig. 2, and the resource processing results including the abnormal resources 1, 2, and 3 are exemplarily shown in the resource processing interface 500.
The related personnel may manually repair the abnormal resources shown in the resource handling interface 500 or may automatically repair the abnormal resources by the client 410. After repairing the abnormal resources in the virtual scene, the effective rate of the resources in the virtual scene can be improved, so that when the virtual scene is output, the abnormal resources (namely useless resources) can be avoided being output, and the actual utilization rate of the computing resources consumed by the electronic equipment (such as the terminal equipment 400) is improved.
When the visual perception of the virtual scene needs to be formed, the terminal device 400 calculates and displays the required data through the graphic calculation hardware, and finishes loading, analyzing and rendering of the display data (such as each resource in the virtual scene), and outputs a video frame capable of forming the visual perception of the virtual scene at the graphic output hardware, for example, a two-dimensional video frame is displayed on a display screen of the smart phone, or a video frame for realizing a three-dimensional display effect is projected on a lens of the augmented reality/virtual reality glasses; in addition, to enrich the perception effect, the terminal device 400 may also form one or more of auditory perception (e.g. by means of a microphone), tactile perception (e.g. by means of a vibrator), motion perception and gustatory perception by means of different hardware. It should be noted that, the client for outputting the virtual scene in the terminal device 400 may be the client 410 or other clients.
In some embodiments, taking an electronic device as a server as an example, the method for processing resources in a virtual scene provided in the embodiments of the present application may be implemented cooperatively by the server and the terminal device, and is suitable for completing the calculation of relevant data and the processing of resources of the virtual scene depending on the calculation capability of the server 200, and outputting abnormal resources and actual application scenes of the virtual scene at the terminal device 400.
The terminal device 400 may run the client 410, and the client 410 presents the resource handling interface 500 during the run. The client 410 acquires a check policy set for the virtual scene in response to a policy setting operation received in the resource processing interface 500. Then, the client 410 transmits the inspection policy to the server 200, so that the server 200 performs resource processing on the virtual scene according to the acquired inspection policy to determine an abnormal resource among the plurality of resources included in the virtual scene. Server 200 may send the determined abnormal resource (e.g., the name of the abnormal resource) to client 410 to update resource handling interface 500 of client 410. Similarly, for the abnormal resources, the server 200 may repair the abnormal resources in the virtual scene according to the repair instruction received by the client 410, that is, the related personnel manually control the server 200 to repair the abnormal resources; or server 200 may automatically repair the abnormal resources.
After the repair of the abnormal resources in the virtual scene is completed, the virtual scene can be output. Taking the example of forming the visual perception of the virtual scene, the server 200 performs calculation of the virtual scene related display data (such as each resource in the virtual scene) and sends the calculated display data to the terminal device 400, and the terminal device 400 completes loading, parsing and rendering of the calculated display data depending on the graphics computing hardware, and outputs the virtual scene depending on the graphics output hardware to form the visual perception.
In some embodiments, the terminal device 400 may implement the resource processing method in the virtual scenario provided by the embodiment of the present application by running a computer program, for example, the computer program may be a native program or a software module in an operating system; a Native Application (APP), i.e. a program that needs to be installed in an operating system to run; the method can also be an applet, namely a program which can be run only by being downloaded into a browser environment; but also an applet that can be embedded in any APP. In summary, the computer program may be any form of application, module or plug-in, for example, a plug-in embedded in a virtual scene engine. In addition, the virtual scene in the embodiment of the present application may be a game virtual scene, where the game may be a multiplayer online tactical competition (MOBA, multiplayer Online Battle Arena) game or a multiplayer gunfight survival game, which is not limited, and of course, this does not constitute a limitation to the virtual scene.
In some embodiments, the server 200 may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms, for example, the cloud services may be resource processing services, which are called by the terminal device 400 to determine abnormal resources among a plurality of resources included in the virtual scenario. Cloud Technology (Cloud Technology) refers to a hosting Technology that unifies serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The terminal device 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart television, and the like. The terminal device 400 and the server 200 may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
Taking the electronic device provided by the embodiment of the present application as an example of a terminal device, it can be understood that, in the case where the electronic device is a server, portions (such as a user interface, a presentation module, and an input processing module) in the structure shown in fig. 3 may be default. Referring to fig. 3, fig. 3 is a schematic structural diagram of a terminal device 400 provided in an embodiment of the present application, and the terminal device 400 shown in fig. 3 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in terminal device 400 are coupled together by bus system 440. It is understood that the bus system 440 is used to enable connected communication between these components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled in fig. 3 as bus system 440.
The Processor 410 may be an integrated circuit chip having signal processing capabilities such as a general purpose Processor, such as a microprocessor or any conventional Processor, a digital signal Processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable presentation of the media content. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
Memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 450 optionally includes one or more storage devices physically remote from processor 410.
Memory 450 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM) and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 450 described in embodiments of the present application is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 451 including system programs, e.g., framework layer, core library layer, driver layer, etc., for handling various basic system services and performing hardware-related tasks, for implementing various basic services and handling hardware-based tasks;
Network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: bluetooth, wireless compatibility authentication (WiFi), and universal serial bus (USB, universal Serial Bus), etc.;
A presentation module 453 for enabling presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, speakers, etc.) associated with the user interface 430;
An input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software, and fig. 3 shows a resource processing apparatus 455 in a virtual scene stored in a memory 450, which may be software in the form of a program and a plug-in, and includes the following software modules: the acquisition module 4551, the mapping module 4552, the matching module 4553 and the updating module 4554 are logical, so that any combination or further splitting may be performed according to the implemented functions. The functions of the respective modules will be described hereinafter.
Referring to fig. 4, fig. 4 is a schematic diagram of a virtual scene engine according to an embodiment of the present application, where the virtual scene is a game virtual scene, the virtual scene engine may be a game engine. For ease of understanding, the game engine is described by way of example as the core component of a number of well-defined editable computer game systems or interactive real-time image applications that provide game designers with the various tools required to program a game in order to allow the game designers to easily and quickly make game programs without starting from zero, while the game engine is also the engine of the game that controls the operation of the game, i.e., controls the output of virtual scenes of the game. Game engines include, but are not limited to, editors, rendering engines (i.e., "renderers," including two-dimensional and three-dimensional image engines), physics engines, special effects, sound effects, script engines, skeletal animations, models, user interfaces (engine interfaces), underlying algorithms, network engines, and scene management. At the underlying level, the game engine is a set of codes (instructions) that can be recognized by the electronic device. Items of a game virtual scene (e.g., game applications) may include both game engines and game resources, including maps, sounds, animations, etc., which are ordered (loaded) according to the game design requirements (i.e., according to the designed program code).
The method for processing resources in a virtual scenario according to the embodiment of the present application may be implemented by each module in the resource processing device 455 in the virtual scenario shown in fig. 3 invoking the related components of the game engine shown in fig. 4, and is described below by way of example.
For example, the acquisition module 4551 is configured to invoke a user interface component in the game engine to acquire an inspection policy set for the virtual scene in a user interface (resource processing interface), where the resource processing interface may be provided by an editor component or other component in the game engine; the mapping module 4552 is used for calling a bottom algorithm component and an editor component in the game engine to map the attribute to be checked of the resource in the virtual scene into a callable object, so as to obtain an attribute value of the resource corresponding to the attribute to be checked; the matching module 4553 is used for calling a bottom algorithm component and an editor component in the game engine to match the attribute value of the attribute to be checked corresponding to the resource with the attribute value condition corresponding to the attribute to be checked, and determining the abnormal resource in the virtual scene according to the obtained matching result; the update module 4554 is configured to invoke the user interface component to update the resource handling interface based on the abnormal resource.
Of course, the above examples are not limited to the embodiments of the present application, and the calling relationships of each component included in the game engine and each module in the resource processing device 455 in the virtual scene to the components in the game engine may be adjusted according to the actual application scenario.
The method for processing resources in a virtual scene provided by the embodiment of the application will be described in connection with the exemplary application and implementation of the electronic device provided by the embodiment of the application.
Referring to fig. 5A, fig. 5A is a schematic flow chart of a method for processing resources in a virtual scene according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 5A.
In step 101, in response to a policy setting operation received in a resource processing interface, acquiring an inspection policy set for a virtual scene; the checking strategy comprises the name of the attribute to be checked and the attribute value condition corresponding to the attribute to be checked.
The virtual scene often comprises a plurality of resources, wherein the resources often comprise abnormal resources with unsatisfactory attribute values, the abnormal resources are generated in various reasons, for example, related personnel (such as developers, art staff and the like) introduce wrong resources in the virtual scene, and the attribute values of the existing resources are not updated in time when the virtual scene version iterates. If a virtual scene including abnormal resources is output, the computing resources consumed by the electronic equipment in the output process are wasted, and meanwhile, the effect of man-machine interaction is affected by the abnormal resources, so that the user experience is reduced.
Therefore, in the embodiment of the application, the resource processing is performed on the virtual scene to determine the abnormal resources in the virtual scene. First, a resource processing interface is presented, and when a policy setting operation is received in the resource processing interface, a check policy set for a virtual scene is acquired. Wherein the resource processing interface may be an interface of a virtual scene engine independent of the virtual scene, such as an independent Web interface; or may be a user interface provided by a virtual scene engine, such as by an editor component of the virtual scene engine.
The obtained inspection policy at least includes a name of the attribute to be inspected and an attribute value condition corresponding to the attribute to be inspected, and of course, other contents may also be included, which will be further described later, where the attribute value condition may be set according to an actual application scenario. An inspection policy may include a plurality of attribute value conditions corresponding to the attribute to be inspected, provided that the attribute value conditions cannot conflict with each other, e.g., an inspection policy includes both an attribute value condition of "greater than 50" and an attribute value condition of "less than 100". For one attribute to be checked, a plurality of check strategies can also be simultaneously corresponding.
It should be noted that the obtained inspection policy includes content that can be parsed by the electronic device, and the electronic device can execute the resource processing operation according to the inspection policy, so as to implement the resource processing function. Wherein the relevant logic for parsing the inspection policies may be pre-deployed in the electronic device, e.g. pre-storing code (e.g. scripts) for parsing the inspection policies. In some embodiments, the acquired inspection policy may also be in a code form, and the electronic device may directly execute the acquired inspection policy to implement the resource processing function.
In some embodiments, after step 101, further comprising: and responding to the strategy multiplexing operation aiming at any one attribute in the virtual scene, replacing the name of the attribute to be checked in the checking strategy with the name of any one attribute, and taking the attribute value condition corresponding to the attribute to be checked as the attribute value condition of any one attribute to obtain a new checking strategy.
After the inspection policy corresponding to the attribute to be inspected is obtained, the inspection policy may be multiplexed to the attribute different from the attribute to be inspected. For example, the attribute to be inspected corresponding to the obtained inspection policy is a mapping height (for convenience of explanation, named as attribute a) in the Android operating system, and the attribute value condition in the inspection policy is "mapping height is less than 100 pixels". When a policy multiplexing operation for any one attribute in the virtual scene (for convenience of explanation, the attribute is taken as a mapping high example in the iOS operating system and named as an attribute B) is received, the name of the attribute a in the inspection policy is replaced by the name of the attribute B, and the attribute value condition in the inspection policy is taken as the attribute value condition of the attribute B, so that the inspection policy corresponding to the attribute B is obtained. As for the checking policy corresponding to attribute a, reservation may continue.
In order to facilitate policy multiplexing, a plurality of attributes and policy multiplexing options corresponding to each attribute can be presented in a resource processing interface, and a received trigger operation of the policy multiplexing option corresponding to any one attribute is used as a policy multiplexing operation for the attribute. In addition, if a plurality of inspection policies have been acquired, all inspection policies may be presented in the resource processing interface when a policy multiplexing operation is received, and policy multiplexing may be performed according to the selected inspection policies when a selection operation for the presented plurality of inspection policies is received. Through the mode, the setting workload of the inspection strategy can be reduced, and the labor cost is saved.
In step 102, according to the name of the attribute to be checked, the attribute to be checked of the resource in the virtual scene is mapped into a callable object, and the attribute value of the attribute to be checked of the resource is obtained by calling the callable object corresponding to the attribute to be checked.
After the inspection strategy is acquired, the attribute value of the resource corresponding to the attribute to be inspected in the virtual scene can be acquired according to the name of the attribute to be inspected in the inspection strategy. In the embodiment of the application, the acquisition of the attribute value is mainly realized based on a reflection mechanism, for example, the attribute to be checked of the resource in the virtual scene can be mapped into the callable object according to the name of the attribute to be checked, and the attribute value of the attribute to be checked corresponding to the resource is obtained by calling the callable object corresponding to the attribute to be checked, and the calling of the callable object corresponding to the attribute to be checked can refer to the calling of the value method (the value function) in the callable object.
The embodiment of the application does not limit the mapping mode, for example, the attribute to be checked of the resource in the virtual scene can be mapped into the PropertyInfo object according to the PropertyInfo class, and the attribute value of the resource corresponding to the attribute to be checked can be obtained by calling the GetValue method of the PropertyInfo object. Therefore, for different attributes to be checked, only one set of codes for acquiring the attribute values according to the names is required to be configured, and independent configuration is not required for the different attributes to be checked.
It should be noted that, step 102 may be performed for each resource in the virtual scene, or the plurality of resources in the virtual scene may be filtered to obtain the resource to be inspected, and then step 102 may be performed for each resource to be inspected. For example, a resource having an attribute to be checked in the virtual scenario and set to be effective may be used as the resource to be checked, and other resources are ignored, where the attribute of the resource may be set according to the actual application scenario. In the embodiment of the application, the attribute can be configured whether to take effect or not, for example, effective configuration options corresponding to the attribute can be presented in a resource processing interface. When a certain attribute of a resource is configured to be inactive, it may be considered that the resource does not have the attribute.
It should be noted that, in the embodiment of the present application, the attribute value may be obtained by using the capability of the virtual scene engine, or may be obtained according to a tool (such as a client tool) independent of the virtual scene engine.
In some embodiments, prior to step 102, further comprising: multiplexing the attribute of the parent resource into the child resource in response to an attribute multiplexing operation for any one of the resource types in the virtual scene; wherein, the father resource is a resource successfully matched with any resource type in the virtual scene; child resources are resources in the virtual scene that are distinct from parent resources.
In addition to policy multiplexing, the embodiments of the present application may also support attribute multiplexing. For example, when an attribute multiplexing operation for any one of the resource types in the virtual scene is received, a resource that is successfully matched with the resource type (i.e., conforms to the resource type) is taken as a parent resource, a resource that is different from the parent resource is taken as a child resource, and the attribute of the parent resource is multiplexed into the child resource, i.e., the child resource has the multiplexed attribute. For example, the resource of the resource type as the basic type may be preset, and its attributes include a name, a path, and a memory, and when the attribute multiplexing operation for the basic type is received, all the attributes of the resource type as the basic type are multiplexed into the sub-resources, such as the sub-resource of the resource type as the map, the sub-resource of the resource type as the grid, and the sub-resource of the resource type as the animation. It should be noted that the attributes of multiple resources that are successfully matched to the same resource type are typically the same. In addition, after the parent resource is determined, part of the resources different from the parent resource can be used as child resources, for example, some resources can be manually screened out to be used as child resources.
Of course, in the embodiment of the present application, customization of the attribute of the resource may be supported. For example, after a child resource inherits the properties of a parent resource, the properties of the child resource may be further updated, such as adding or deleting properties. For example, for sub-resources whose resource type is a map, attributes such as height, width, and readability may be further increased; for the sub-resource with the resource type of grid, the attributes such as grid number, top point number and readability can be further increased; for the child resources with the resource type of animation, the attributes such as animation curves, key frames, import modes and the like can be further added. Through the mode, the workload of attribute setting can be reduced, the labor cost is saved, and quick and effective setting is realized.
In some embodiments, the mapping of the attributes to be checked of the resources in the virtual scene to callable objects according to the names of the attributes to be checked may be achieved in such a way that: acquiring white list resources in a virtual scene; and mapping the attribute to be checked of the resource which is positioned in the virtual scene and is different from the white list resource into a callable object according to the name of the attribute to be checked.
Here, the white list resource in the virtual scene may be obtained, and the resource different from the white list resource is used as the resource to be checked, so as to implement resource screening, that is, the white list resource is added into the screening condition. Then, according to the name of the attribute to be checked, the attribute to be checked of the resource to be checked is mapped into a callable object, and the attribute to be checked is ignored for the white list resource, so that the workload of resource processing can be effectively reduced. The white list resource may be set according to an actual application scenario, for example, a resource whose update frequency of attribute values (that is, attribute values corresponding to all attributes of the resource) in the virtual scenario is less than a frequency threshold is used as the white list resource.
In some embodiments, the mapping of the attributes to be checked of the resources in the virtual scene to callable objects according to the names of the attributes to be checked may be achieved in such a way that: obtaining a blacklist resource in a virtual scene; and mapping the attribute to be checked of the blacklist resource into a callable object according to the name of the attribute to be checked.
Here, the blacklist resource in the virtual scene may be used as the resource to be checked, and the resource different from the blacklist resource may be ignored, that is, the blacklist resource is added to the filtering condition. The blacklist resource can be set according to an actual application scene, for example, a resource with the attribute value update frequency greater than or equal to a frequency threshold in the virtual scene is used as the blacklist resource. By the method, pertinence of resource processing can be improved.
In step 103, matching the attribute value of the attribute to be checked corresponding to the resource with the attribute value condition corresponding to the attribute to be checked, and determining the abnormal resource in the virtual scene according to the obtained matching result.
After obtaining the attribute value of the attribute to be checked corresponding to the resource, matching the attribute value with the attribute value condition corresponding to the attribute to be checked, and judging whether the resource is an abnormal resource according to the matching result, wherein the judging mode is described later.
In the embodiment of the application, the type of the inspection strategy can be set. For example, types include, but are not limited to, out-of-specification checks and reference loss checks, for which the attribute value condition may be that the attribute value is less than a certain threshold or greater than a certain threshold for a check policy whose type is out-of-specification checks; for an inspection policy with a type of reference loss inspection, the attribute to be inspected in the inspection policy may be a reference attribute, and the attribute value condition may be that the attribute value is not equal to zero, where if the attribute value of the reference attribute is zero, the reference loss occurs.
In step 104, the resource handling interface is updated based on the abnormal resource.
After determining the abnormal resources, the resource processing interface may be updated according to the abnormal resources, for example, the abnormal resources may be presented in the resource processing interface, where presenting the abnormal resources may refer to presenting the abnormal resources corresponding to the attribute values of the attribute having the identification function, for example, at least one of the attribute values of the name attribute and the attribute values of the path attribute. On the basis, the attribute value of the abnormal resource corresponding to the attribute to be checked can be presented, so that related personnel can be reminded of updating the attribute value, and the repair of the abnormal resource is realized; the resource type of the abnormal resource and the module to which the abnormal resource belongs can be presented, so that related personnel can quickly locate the abnormal resource; the type of inspection policy used to determine the abnormal resources may also be presented in order for the relevant personnel to locate the cause of the abnormality, such as an attribute value that is out of specification or a reference that is lost.
In addition to updating the resource processing interface, in the embodiment of the application, the alarm can be performed according to the abnormal resources, such as a short message or mail.
It should be noted that, since the attribute values of the resources in the virtual scene may be continuously changed (e.g. undergo version iteration), steps 102 to 104 may be periodically performed to monitor the abnormal resources in the virtual scene in real time.
In some embodiments, the number of inspection policies includes a plurality, and each inspection policy corresponds to a risk level; after step 101, the method further includes: traversing a plurality of inspection strategies; the traversed checking strategy is used for determining abnormal resources in the virtual scene; the above-described updating of the resource handling interface according to the abnormal resources may be achieved in such a way that: presenting a plurality of abnormal resources in a resource processing interface, wherein the presenting modes of the abnormal resources corresponding to different risk levels are different; the risk level corresponding to the abnormal resource is a risk level corresponding to an inspection strategy for determining the abnormal resource.
In the embodiment of the application, the number of the acquired inspection strategies can include a plurality of inspection strategies, and for the case, the plurality of inspection strategies can be traversed, and abnormal resources in the virtual scene are determined according to the traversed inspection strategies. On the basis, if each inspection strategy corresponds to one risk level, the risk level corresponding to the traversed inspection strategy can be used as the risk level corresponding to the abnormal resource determined according to the traversed inspection strategy. The risk levels corresponding to different inspection strategies can be the same or different. The risk level can comprise a high level and a low level, and can be set according to the actual application scene.
When the traversing is completed, all the determined abnormal resources can be presented in the resource processing interface, and the presentation modes of the abnormal resources corresponding to different risk levels are different, so that related personnel can distinguish. Wherein, the different presentation modes may refer to at least one of different presentation contents, presentation fonts, presentation sizes and presentation colors. As an example, the embodiment of the present application provides a schematic diagram of a resource processing interface as shown in fig. 6, abnormal resources 1 to 5 are presented in a list form, wherein risk levels of the abnormal resources 1 to 3 are all high, and risk levels of the abnormal resources 4 to 5 are all low, so that presentation sizes corresponding to the abnormal resources 1 to 3 are larger than presentation sizes corresponding to the abnormal resources 4 to 5. Through the mode, the degree of distinction between the abnormal resources corresponding to different risk levels can be improved, and related personnel can be reminded to repair the abnormal resources with higher risk levels preferentially.
In some embodiments, the above-described updating of the resource handling interface according to abnormal resources may be implemented in such a way that: the method comprises the steps of presenting abnormal resources in a resource processing interface and resources different from the abnormal resources in a virtual scene, wherein the abnormal resources are different from the resources different from the abnormal resources in the presentation mode.
Here, only the abnormal resource may be presented in the resource processing interface, or the abnormal resource and the resource (for convenience of distinction, named as normal resource) different from the abnormal resource in the virtual scene may be presented at the same time, and the presentation manner of the abnormal resource and the normal resource is different. Similarly, the different rendering modes herein may also refer to at least one of rendering content, rendering font, rendering size, and rendering color. As an example, an embodiment of the present application provides a schematic diagram of a resource processing interface as shown in fig. 7, in which abnormal resources 1 to 3 are presented in a larger presentation size, while normal resources 4 to 5 are presented in a smaller presentation size in fig. 7. By the method, the comprehensiveness of the content presented in the resource processing interface can be improved, meanwhile, the distinction between the abnormal resource and the normal resource is enhanced, and related personnel can repair the abnormal resource conveniently, for example, the attribute value of the abnormal resource corresponding to the attribute to be checked is updated according to the attribute value of the normal resource corresponding to the attribute to be checked.
As shown in fig. 5A, the embodiment of the present application performs automatic resource processing according to the inspection policy configured in the resource processing interface, so as to reduce the implementation cost of resource processing, and effectively reduce the occupation of computing resources of the electronic device in the resource processing process.
In some embodiments, referring to fig. 5B, fig. 5B is a schematic flow diagram of a method for processing resources in a virtual scene according to an embodiment of the present application, step 101 shown in fig. 5A may be updated to step 201, and in step 201, in response to a policy setting operation received in a resource processing interface, a check policy set for the virtual scene is obtained; the checking strategy comprises the name of the attribute to be checked, the attribute value condition corresponding to the attribute to be checked, the name of the attribute to be screened and the attribute value condition corresponding to the attribute to be screened.
Here, the obtained inspection policy may further include a name of the attribute to be inspected and an attribute value condition corresponding to the attribute to be inspected, and the name of the attribute to be screened and the attribute value condition corresponding to the attribute to be screened, where the name of the attribute to be screened and the attribute value condition corresponding to the attribute to be screened are used to screen the resource to be inspected from a plurality of resources included in the virtual scene, that is, the resource to be inspected is used as a screening condition.
In fig. 5B, based on fig. 5A, after step 201, in step 202, according to the name of the attribute to be filtered, the attribute to be filtered of the resource in the virtual scene is mapped to a callable object, and the attribute value of the attribute to be filtered corresponding to the resource is obtained by calling the callable object corresponding to the attribute to be filtered.
Here, for each resource in the virtual scene, an attribute value corresponding to the attribute to be filtered is also obtained based on the reflection mechanism. For example, according to the name of the attribute to be filtered, the attribute to be filtered of the resource in the virtual scene is mapped into a callable object, and the attribute value of the resource corresponding to the attribute to be filtered is obtained by calling the callable object.
In step 203, matching the attribute value of the attribute to be filtered corresponding to the resource with the attribute value condition corresponding to the attribute to be filtered, and determining the resource to be checked in the virtual scene according to the obtained matching result.
After obtaining the attribute value of the attribute to be screened corresponding to the resource, matching the attribute value with the attribute value condition corresponding to the attribute to be screened, and determining whether the resource is the resource to be checked according to the obtained matching result.
It should be noted that, if other screening conditions exist, the resource screening may be performed before the step 202, and the steps 202 and 203 may be performed for each resource that is screened out; the resulting resource to be inspected may also be further screened after step 203.
In some embodiments, the number of inspection policies includes a plurality; after step 201, the method further includes: traversing a plurality of inspection strategies; the traversed checking strategy is used for determining resources to be checked in the virtual scene; after step 203, the method further includes: and when the number of the resources to be checked determined according to the traversed checking strategy is zero, continuing to traverse the next checking strategy.
Here, when the number of acquired inspection policies includes a plurality of, the plurality of inspection policies may be traversed, and the resource to be inspected in the virtual scene may be determined according to the traversed inspection policies. When the number of the resources to be checked is zero according to the checked strategy, the next checked strategy is directly traversed, so that the efficiency of resource processing is improved, and invalid processing is avoided.
In some embodiments, the above determination of the resources to be checked in the virtual scene according to the obtained matching result may be implemented in such a way: the following is performed for each resource in the virtual scene: when the matching result of the resource corresponding to the attribute to be screened is successful, taking the resource as the resource to be checked; and when the matching result of the resource corresponding to the attribute to be screened is that the matching fails, ignoring the resource.
Here, for each resource in the virtual scene, when the matching result of the resource corresponding to the attribute to be screened is successful, the resource is used as the resource to be checked; and when the matching result of the resource corresponding to the attribute to be screened is that the matching fails, ignoring the resource. For example, if the attribute to be screened in the inspection policy is a material and the attribute value corresponding to the attribute to be screened is "the material is a metal", the determined attribute values of the attribute of the material corresponding to the resource to be inspected are all metals. By the method, the effectiveness of resource screening according to the inspection strategy can be improved.
Of course, this does not limit the embodiment of the present application, for example, when the matching result of the resource corresponding to the attribute to be filtered is that the matching is successful, the resource may be ignored; and when the matching result of the resource corresponding to the attribute to be screened is that the matching fails, taking the resource as the resource to be checked.
In fig. 5B, step 102 shown in fig. 5A may be updated to step 204, in step 204, according to the name of the attribute to be inspected, the attribute to be inspected of the resource to be inspected in the virtual scene is mapped to a callable object, and the attribute value of the attribute to be inspected corresponding to the attribute to be inspected of the resource to be inspected is obtained by calling the callable object corresponding to the attribute to be inspected.
After the resource to be checked is obtained, only the resource to be checked can be subjected to subsequent processing. For example, for each resource to be inspected, mapping the attribute to be inspected of the resource to be inspected into a callable object according to the name of the attribute to be inspected, and obtaining the attribute value of the attribute to be inspected corresponding to the resource to be inspected by calling the callable object
In fig. 5B, step 103 shown in fig. 5A may be updated to step 205, in step 205, matching the attribute value of the attribute to be inspected corresponding to the resource to be inspected with the attribute value condition corresponding to the attribute to be inspected, and determining the abnormal resource in the virtual scene according to the obtained matching result.
And for each resource to be checked, a matching result corresponding to the attribute to be checked can be obtained, so that abnormal resources can be determined in all the resources to be checked to update the resource processing interface.
As shown in fig. 5B, in the embodiment of the present application, the resources to be checked are first screened out from all the resources included in the virtual scene, and then the abnormal resources are screened out from all the resources to be checked, which can effectively reduce the workload of resource processing and improve the resource processing efficiency.
In some embodiments, referring to fig. 5C, fig. 5C is a schematic flow chart of a resource processing method in a virtual scene according to an embodiment of the present application, and step 101 shown in fig. 5A may be implemented by steps 301 to 303, and will be described in connection with the steps.
In step 301, a plurality of attributes are presented in a resource processing interface.
In the embodiment of the application, the checking strategy set for the virtual scene can be acquired based on the selected operation and the condition setting operation. First, various attributes are presented in the resource processing interface, for example, all the attributes in the virtual scene may be presented, or the filtered attributes may be presented.
In step 302, in response to a selection operation for a plurality of attributes, the name of the selected attribute is taken as the name of the attribute to be checked.
Here, when a selection operation (such as a click operation or a long press operation) for a plurality of attributes is received, the selected attribute is taken as an attribute to be checked, that is, the name of the selected attribute is taken as the name of the attribute to be checked.
In step 303, in response to a condition setting operation for the attribute to be inspected, an attribute value condition set for the attribute to be inspected is acquired.
For example, a condition setting interface corresponding to the attribute to be inspected may be presented, and an attribute value condition set for the attribute to be inspected may be acquired in response to a condition setting operation for the attribute to be inspected received in the condition setting interface. The condition setting interface can exist independently of the resource processing interface, and can also be presented in a window form in the resource processing interface.
It should be noted that, in response to the condition setting operation for the attribute to be filtered received in the condition setting interface, the attribute value condition set for the attribute to be filtered may be obtained, and at the same time, the name of the attribute to be filtered may also be obtained.
In some embodiments, the above-described presentation of multiple attributes in a resource processing interface may be implemented in such a way: presenting a plurality of screening conditions in a resource processing interface; the screening conditions comprise at least one of resource types and modules to which the resources belong; the virtual scene comprises a plurality of modules, and each module comprises a plurality of resources; in response to a selected operation for the plurality of screening conditions, a plurality of attributes of the resource that successfully matches the selected screening condition are presented.
Here, a plurality of filtering conditions may be presented in the resource processing interface, each filtering condition including at least one of a resource type and a module to which the resource belongs. For example, all resource types in the virtual scene and/or all modules in the virtual scene may be presented in the resource processing interface.
Wherein the virtual scene comprises a plurality of modules, each module comprises a plurality of resources, for example, in the game virtual scene, a plurality of modules such as characters (virtual characters), weapons, monsters and the like can be divided, wherein the character module comprises a plurality of resources corresponding to the characters, for example, a plurality of mapping resources for constructing character images, and the weapon module is the same as the monster module.
When the selected operation aiming at the presented multiple screening conditions is received, the resource successfully matched with the selected screening conditions is used as the resource to be checked, and multiple attributes of the resource to be checked are presented in the resource processing interface, so that related personnel can determine the attribute to be checked from the multiple attributes. For example, the filtering condition includes a map type, and then all resources with the resource type of the map type in the virtual scene can be used as the resources to be checked. In the above manner, the selected screening condition is the screening condition meeting the requirement of the user, and by presenting various attributes of the resource to be checked, the variety of the attributes to be presented can be reduced, the computing resource of the electronic equipment is saved, and meanwhile, the related personnel can conveniently and rapidly determine the attribute to be checked.
In some embodiments, the mapping of the attribute to be checked of the resource in the virtual scene to the callable object according to the name of the attribute to be checked may be implemented in such a way as to: and mapping the attribute to be checked of the resource which is positioned in the virtual scene and successfully matched with the selected screening condition into a callable object according to the name of the attribute to be checked.
Here, the resource successfully matched with the selected screening condition can be used as the resource to be checked, only the attribute value of the resource to be checked corresponding to the attribute to be checked is obtained, and other resources are ignored, so that the workload of resource processing is reduced.
On the basis, if the checking strategy comprises the name of the attribute to be checked and the attribute value condition corresponding to the attribute to be checked, the resource successfully matched with the selected checking condition can be further checked according to the name of the attribute to be checked and the attribute value condition corresponding to the attribute to be checked, so as to obtain the resource to be checked. Of course, the multiple resources in the virtual scene may be screened according to the name of the attribute to be screened and the attribute value condition corresponding to the attribute to be screened, and then the screened resources may be further screened according to the selected screening condition, so as to obtain the resource to be checked. Through the mode, the workload of resource processing can be reduced, and the efficiency is improved.
As shown in fig. 5C, in the embodiment of the present application, the policy setting operation is split into the selected operation and the condition setting operation, which can enhance the man-machine interaction experience, and is convenient to improve the accuracy of the set inspection policy.
In some embodiments, referring to fig. 5D, fig. 5D is a schematic flow chart of a method for processing resources in a virtual scene according to an embodiment of the present application, and step 103 shown in fig. 5A may be implemented by steps 401 to 403, which will be described in connection with the steps.
In step 401, matching processing is performed on the attribute value of the attribute to be inspected corresponding to the resource and the attribute value condition corresponding to the attribute to be inspected.
After obtaining the attribute value of the attribute to be checked corresponding to the resource, matching the attribute value with the attribute value condition corresponding to the attribute to be checked.
In step 402, when the matching result of the resource corresponding to the attribute to be checked is that the matching is successful, the resource is ignored.
In step 403, when the matching result of the resource corresponding to the attribute to be checked is that the matching fails, the resource is regarded as an abnormal resource.
The embodiment of the application provides an example for determining abnormal resources, and when the matching result of a certain resource corresponding to the attribute to be checked is successful, the resource is ignored; and when the matching result of the resource corresponding to the attribute to be checked is that the matching fails, taking the resource as an abnormal resource. For ease of understanding, the following description will be made in terms of this example.
Of course, this does not limit the embodiment of the present application, for example, when the matching result of a resource corresponding to the attribute to be checked is successful, the resource may be used as an abnormal resource; and when the matching result of the resource corresponding to the attribute to be checked is that the matching fails, ignoring the resource.
In fig. 5D, step 104 shown in fig. 5A can be implemented by steps 404 to 405, and the respective steps will be described.
In step 404, an exception resource, and an exception repair option for the exception resource, is presented in the resource handling interface.
In the embodiment of the application, the automatic repairing function is provided besides the mode of manually repairing the abnormal resources by related personnel. For example, for each exception resource presented, a corresponding exception repair option may also be presented.
In step 405, in response to the triggering operation for the exception repairing option, the attribute value of the attribute to be checked corresponding to the exception resource is updated, so that the updated attribute value is successfully matched with the attribute value condition corresponding to the attribute to be checked.
Here, when a trigger operation (such as a click operation or a long press operation) for the exception repairing option is received, an update process is performed on the attribute value of the attribute to be checked corresponding to the exception resource, so that the updated attribute value is successfully matched with the attribute value condition corresponding to the attribute to be checked. Thus, the automatic repair of the abnormal resources can be realized.
For example, if the attribute value condition includes a single attribute value, the attribute value of the attribute to be checked corresponding to the abnormal resource may be updated to the attribute value in the attribute value condition; if the attribute value condition includes an attribute value range (e.g., 50 to 100), the attribute value of the attribute to be checked corresponding to the abnormal resource may be updated to any value (e.g., a minimum value or a maximum value) in the attribute value range.
In some embodiments, the above-described updating of the resource handling interface according to abnormal resources may be implemented in such a way that: determining the degree of difference between the attribute value of the attribute to be inspected corresponding to the abnormal resource and the attribute value condition corresponding to the attribute to be inspected; determining a risk level corresponding to the abnormal resource according to the difference degree; and presenting a plurality of abnormal resources in the resource processing interface, wherein the abnormal resources corresponding to different risk levels are presented in different modes.
In the embodiment of the application, for each abnormal resource, the degree of difference between the attribute value of the attribute to be checked corresponding to the abnormal resource and the attribute value condition corresponding to the attribute to be checked can be determined. For example, if the attribute value condition includes a single attribute value, an absolute value of a difference value between the attribute value of the attribute to be inspected corresponding to the abnormal resource and the attribute value in the attribute value condition may be used as the degree of difference corresponding to the abnormal resource; if the attribute value condition includes an attribute value range, an absolute value of a difference value between an attribute value of the attribute to be inspected corresponding to the abnormal resource and any one attribute value (e.g., fixed to a minimum value or fixed to a maximum value) in the attribute value range may be used as a difference degree corresponding to the abnormal resource.
The greater the degree of difference of the abnormal resources, the more abnormal the abnormal resources are, and the higher the risk level corresponding to the abnormal resources is, namely the risk level is positively correlated with the degree of difference. In order to embody the distinction between the abnormal resources corresponding to different risk levels, a plurality of abnormal resources may be presented in the resource processing interface, and the manner of presenting the abnormal resources corresponding to different risk levels is different, as shown in fig. 6. Wherein, the different presentation modes may refer to at least one of different presentation contents, presentation fonts, presentation sizes and presentation colors.
As shown in fig. 5D, according to the attribute value condition corresponding to the attribute to be inspected, the embodiment of the application automatically updates the attribute value of the attribute to be inspected corresponding to the abnormal resource, thereby realizing automatic repair of the abnormal resource.
In the following, an exemplary application of the embodiment of the present application in an actual application scenario will be described, for convenience of understanding, taking a virtual scenario as an example of a game virtual scenario developed based on a game engine (such as a Unity game engine), which, of course, does not constitute a limitation on the virtual scenario engine and the virtual scenario.
The embodiment of the present application provides a schematic diagram of a resource processing interface as shown in fig. 8A, and in fig. 8A, a case where the resource processing interface 81 is a Web interface is taken as an example. In response to a trigger operation (e.g., a click operation or a long press operation, etc.) for the "resource attribute configuration" option in the resource processing interface 81, various attributes in the game virtual scene are presented in the resource processing interface 81. Here, a plurality of filtering conditions may be presented first, and in response to a selection operation for the plurality of filtering conditions, a plurality of attributes of the resource successfully matched with the selected filtering conditions may be presented, where the filtering conditions include at least one of a resource type, a module to which the resource belongs, and a validation result (i.e., whether or not the attribute is validated), and the inspection rule corresponds to the above inspection policy. In fig. 8A, taking the selected screening condition as the screening condition 82 as an example, the resource types in the screening condition 82 are mapped, and the validation result in the screening condition 82 includes both validation and non-validation.
When the attribute is presented, the attribute name, the attribute description and the validation result of the attribute can be presented, and the resource type of the resource corresponding to the attribute can also be presented, wherein the attribute description is used for the related personnel to know the function of the attribute. Taking attribute 83 in fig. 8A as an example, the resource type is shown as a map, the attribute name is formatiOS, the attribute is described as a map iOS format, and the validation result is validated. In addition, the resource processing interface 81 also provides a modification option 84 for modifying the attribute when triggered, such as modifying the validation result, so as to facilitate the customization of the attribute by related personnel.
In response to a trigger operation for the "check rule configuration" option in the resource processing interface 81, relevant content as shown in fig. 8B may be presented. The screening conditions may include at least one of a rule classification for indicating the type of inspection rule, including but not limited to, out-of-specification inspection and reference loss inspection, and a rule level (corresponding to the above risk level) when configuring the inspection rule, although the screening conditions herein may also be consistent with the screening conditions used to configure the resource attribute. In fig. 8B, taking the selected screening condition as the screening condition 85 as an example, an attribute corresponding to the check rule that the screening condition 85 successfully matches is shown, wherein the rule in the screening condition 85 is classified as all (i.e., all types of check rules are included at the same time), and the rule level in the screening condition 85 is also all (i.e., all rule levels are included at the same time).
In response to a selection operation (such as a click operation or a long press operation) of the plurality of attributes shown in fig. 8B, the selected attribute is taken as an attribute to be checked, and a corresponding rule configuration interface (corresponding to the above condition setting interface) is presented to perform configuration of the check rule. In fig. 8B, the rule configuration interface 86 is shown taking as an example an attribute whose selected attribute is the name of the belonging module, the corresponding resource type is animation, and the attribute name is animation duration. In the rule configuration interface 86, modification of rule classification and rule level of the inspection rule corresponding to the attribute is supported, but modification of the interior of the inspection rule can be supported. In the embodiment of the application, the checking rule may include a pre-set rule and a scanning rule, where the pre-set rule (including the name of the attribute to be checked and the attribute value condition corresponding to the attribute to be checked) is used to screen out the resource to be checked, and the scanning rule (including the name of the attribute to be checked and the attribute value condition corresponding to the attribute to be checked) is used to determine whether the attribute value of the attribute to be checked corresponding to the resource to be checked meets the requirement. The pre-set rule and the scanning rule comprise a function (also called a method) and a parameter, wherein the function is used for representing the relation between the attribute value and the parameter. As shown in fig. 8B, the pre-rule 87 is null, the attribute to be checked in the scan rule 88 is animation duration (in seconds), the function is smaller than 1000, the scan rule 88 means that the animation duration of a resource needs to be smaller than 1000 seconds, and if the animation duration of a resource is greater than or equal to 1000 seconds, the resource is regarded as an abnormal resource (out-of-standard resource). For one attribute in the game virtual scene, a plurality of checking rules can be configured, and a plurality of leading rules and a plurality of scanning rules can be configured in each checking rule, provided that a plurality of leading rules in the same checking rule cannot conflict with each other, and likewise, a plurality of scanning rules in the same checking rule cannot conflict with each other, for example, a scanning rule with an animation time length of more than 1000 seconds and a scanning rule with an animation time length of less than or equal to 1000 seconds cannot exist in the same checking rule at the same time.
It should be noted that, in fig. 8A and 8B, a "white list configuration" option is also shown for configuring white list resources (i.e., resources that do not need to be checked) and/or white list attributes (i.e., attributes that do not need to be checked) in the game virtual scene when triggered; the 'module configuration' option is also shown and is used for configuring the modules in the game virtual scene and the resources included by the modules when triggered, and the related personnel can customize according to the actual scene; also shown is a "resource type configuration" option for configuring the resource type corresponding to the resource in the game virtual scene when triggered, such as modifying the resource type of a resource from a map to an animation.
For configured inspection rules, resource processing may be performed by the game engine or a particular client tool according to the inspection rules to determine abnormal resources in the game virtual scene.
In the bottom implementation, the embodiment of the application mainly comprises two parts, namely attribute configuration and check rule configuration, and the two parts are respectively described below. In the attribute configuration, a resource corresponding to any one resource type can be used as a parent resource, and the attribute of the parent resource is multiplexed into a child resource, namely, attribute multiplexing (or attribute inheritance) is realized, wherein the child resource is a resource different from the parent resource. As shown in FIG. 9, a parent resource is a resource belonging to class SINGLERESDATA, whose attributes include an identification (Identity Document, ID), name, path (ASSETPATH), and occupied memory (Memsize), and child resources include a map resource (i.e., a resource belonging to class TextureDetail), a grid resource (i.e., a resource belonging to class MESHDETAIL), and an animation resource (i.e., a resource belonging to class AnimationDetail). For child resources, the attributes may include additional defined attributes in addition to the identity, name, path, and occupied memory inherited from parent resources, such as the attributes of the map resource include Width (Width), height (Height), and whether readable (Readable) or not; the attributes of the grid resource also include the grid number (Triscount), the vertex number (Vertexcount), whether readable (Readable), etc.; the properties of the animation resources also include animation curves (Totalcurves), key frames (KEYFRAMES), and animation import modes (e.g., legacy modes), etc. For the resource, all the fields are acquired in the form of attributes, and the above attribute configuration has at least the following technical effects: the non-effective attribute can be ignored, and only the effective attribute is processed (such as the attribute value is obtained), so that the calculation amount explosion caused by excessive attributes can be effectively avoided; the unified configuration scheme can be beneficial to unified processing of the attributes, reduces the maintenance amount of codes and improves the elegance of the codes.
In checking rule configuration, the following configuration principles may be supported: 1) One attribute to be checked can be provided with a plurality of checking rules; 2) The inspection rule may include only the scanning rule (i.e., the pre-rule is null), and may also include both the pre-rule and the scanning rule; 3) Multiplexing of inspection rules is supported, i.e. inspection rules for a certain property to be inspected can be multiplexed onto another property.
The resource processing can be performed based on the configured inspection rule, and the embodiment of the application provides a schematic diagram of the resource processing shown in fig. 10, and for a certain attribute to be inspected, an inspection rule list corresponding to the attribute to be inspected is first obtained, where the inspection rule list includes a plurality of inspection rules for illustration. And then traversing the acquired checking rule list, and performing attribute checking according to the pre-set rules in the traversed checking rules, namely screening out resources to be checked in the game virtual scene. When the number of the resources to be checked is larger than zero (i.e. the front-end rule hits), continuing to perform attribute checking according to the scanning rule in the traversed checking rule, namely judging whether the attribute value of the resources to be checked corresponding to the attributes to be checked exceeds the standard; when the number of resources to be checked is equal to zero (i.e. the pre-rule misses), the next check rule in the list of check rules is traversed.
When determining that the attribute value of the resource to be inspected corresponding to the attribute to be inspected exceeds the standard according to the scanning rule in the traversed inspection rule (namely, the scanning rule hits), the traversing can be ended, the resource to be inspected is taken as an abnormal resource (namely, a hit result) and is presented in a resource processing interface, for example, the resource processing interface is presented in a BUG (task oriented group) form, so that related personnel can be reminded of repairing the attribute value of the abnormal resource corresponding to the attribute to be inspected; when all the attribute values of the attributes to be checked corresponding to all the resources to be checked are not out of standard (i.e. the scanning rule is not hit), the next checking rule in the checking rule list is continuously traversed. Repeating the above process until all the inspection rules in the inspection rule list have been traversed, i.e. the attribute inspection has been performed according to all the inspection rules.
The embodiment of the application provides a schematic diagram of attribute checking as shown in fig. 11, for a certain attribute (such as an attribute to be screened for by a pre-rule or an attribute to be checked for a scanning rule), an attribute value can be obtained based on a reflection mechanism, and whether the attribute value exceeds a standard is judged according to a function and a parameter in the checking rule (particularly the pre-rule or the scanning rule). If the attribute value exceeds the standard, hit; if the attribute value does not exceed the standard, then the miss occurs. It should be noted that, in the embodiment of the present application, the purpose of obtaining the attribute value based on the reflection mechanism is to promote the universality and universality of different attributes, that is, it is not necessary to separately write a set of codes for obtaining the attribute value for different attributes.
The embodiment of the application has at least the following technical effects: by configuring the checking rule on the Web interface and acquiring the attribute value through the reflection mechanism, whether the attribute value exceeds the standard is judged according to the checking rule, the requirements of different game virtual scene items, different attributes and different checking rules can be met, the code maintenance cost when the game virtual scene items are accessed is reduced, the access is realized, and meanwhile, the occupation of the computing resources (such as storage resources) of the electronic equipment can be reduced.
Continuing with the description below of an exemplary architecture in which the resource processing device 455 in a virtual scenario provided by embodiments of the present application is implemented as a software module, in some embodiments, as shown in fig. 3, the software module stored in the resource processing device 455 in the virtual scenario of the memory 450 may include: an obtaining module 4551 configured to obtain an inspection policy set for the virtual scenario in response to a policy setting operation received in the resource processing interface; the checking strategy comprises a name of the attribute to be checked and an attribute value condition corresponding to the attribute to be checked; the mapping module 4552 is configured to map the attribute to be inspected of the resource in the virtual scene to a callable object according to the name of the attribute to be inspected, and obtain an attribute value of the attribute to be inspected of the resource by calling the callable object corresponding to the attribute to be inspected; the matching module 4553 is configured to perform matching processing on an attribute value of an attribute to be checked corresponding to the resource and an attribute value condition corresponding to the attribute to be checked, and determine an abnormal resource in the virtual scene according to the obtained matching result; and the updating module 4554 is configured to update the resource processing interface according to the abnormal resource.
In some embodiments, the inspection policy further includes a name of the attribute to be screened, and an attribute value condition corresponding to the attribute to be screened; the mapping module 4552 is further configured to map the attribute to be screened of the resource in the virtual scene into a callable object according to the name of the attribute to be screened, and obtain an attribute value of the attribute to be screened corresponding to the resource by calling the callable object corresponding to the attribute to be screened; the matching module 4553 is further configured to perform matching processing on an attribute value of the attribute to be filtered corresponding to the resource and an attribute value condition corresponding to the attribute to be filtered, and determine a resource to be checked in the virtual scene according to the obtained matching result; wherein the plurality of resources to be inspected are used to be inspected for inclusion of an abnormal resource.
In some embodiments, the number of inspection policies includes a plurality; the resource processing device 455 in the virtual scene further includes a traversal module for: traversing a plurality of inspection strategies; the traversed checking strategy is used for determining resources to be checked in the virtual scene; and when the number of the resources to be checked determined according to the traversed checking strategy is zero, continuing to traverse the next checking strategy.
In some embodiments, the matching module 4553 is further configured to: the following is performed for each resource in the virtual scene: when the matching result of the resource corresponding to the attribute to be screened is successful, taking the resource as the resource to be checked; and when the matching result of the resource corresponding to the attribute to be screened is that the matching fails, ignoring the resource.
In some embodiments, the policy setting operation includes a select operation and a condition setting operation; the acquisition module 4551 is further configured to: presenting a plurality of attributes in a resource processing interface; responding to a selection operation aiming at a plurality of attributes, and taking the name of the selected attribute as the name of the attribute to be checked; in response to a condition setting operation for an attribute to be inspected, an attribute value condition set for the attribute to be inspected is acquired.
In some embodiments, the acquiring module 4551 is further configured to: presenting a plurality of screening conditions in a resource processing interface; the screening conditions comprise at least one of resource types and modules to which the resources belong; the virtual scene comprises a plurality of modules, and each module comprises a plurality of resources; in response to a selected operation for the plurality of screening conditions, a plurality of attributes of the resource that successfully matches the selected screening condition are presented.
In some embodiments, the mapping module 4552 is further to: and mapping the attribute to be checked of the resource which is positioned in the virtual scene and successfully matched with the selected screening condition into a callable object according to the name of the attribute to be checked.
In some embodiments, the matching module 4553 is further configured to: the following is performed for each resource in the virtual scene: when the matching result of the resource corresponding to the attribute to be checked is successful, ignoring the resource; and when the matching result of the resource corresponding to the attribute to be checked is that the matching fails, taking the resource as an abnormal resource.
In some embodiments, the update module 4554 is further configured to: determining the degree of difference between the attribute value of the attribute to be inspected corresponding to the abnormal resource and the attribute value condition corresponding to the attribute to be inspected; determining a risk level corresponding to the abnormal resource according to the difference degree; and presenting a plurality of abnormal resources in the resource processing interface, wherein the abnormal resources corresponding to different risk levels are presented in different modes.
In some embodiments, the update module 4554 is further configured to: presenting an abnormal resource and an abnormal repairing option of the abnormal resource in a resource processing interface; and responding to the triggering operation aiming at the abnormal repair option, and updating the attribute value of the attribute to be checked corresponding to the abnormal resource so as to enable the updated attribute value to be successfully matched with the attribute value condition corresponding to the attribute to be checked.
In some embodiments, the number of inspection policies includes a plurality, and each inspection policy corresponds to a risk level; the resource processing device 455 in the virtual scene further includes a traversal module for: traversing a plurality of inspection strategies; the traversed checking strategy is used for determining abnormal resources in the virtual scene; update module 4554, further configured to: presenting a plurality of abnormal resources in a resource processing interface, wherein the presenting modes of the abnormal resources corresponding to different risk levels are different; the risk level corresponding to the abnormal resource is a risk level corresponding to an inspection strategy for determining the abnormal resource.
In some embodiments, the resource processing device 455 in the virtual scene further includes an attribute multiplexing module for: multiplexing the attribute of the parent resource into the child resource in response to an attribute multiplexing operation for any one of the resource types in the virtual scene; wherein, the father resource is a resource successfully matched with any resource type in the virtual scene; child resources are resources in the virtual scene that are distinct from parent resources.
In some embodiments, the resource processing device 455 in the virtual scenario further comprises a policy multiplexing module for: and responding to the strategy multiplexing operation aiming at any one attribute in the virtual scene, replacing the name of the attribute to be checked in the checking strategy with the name of any one attribute, and taking the attribute value condition corresponding to the attribute to be checked as the attribute value condition of any one attribute to obtain a new checking strategy.
In some embodiments, the mapping module 4552 is further to: acquiring white list resources in a virtual scene; and mapping the attribute to be checked of the resource which is positioned in the virtual scene and is different from the white list resource into a callable object according to the name of the attribute to be checked.
In some embodiments, the update module 4554 is further configured to: the method comprises the steps of presenting abnormal resources in a resource processing interface and resources different from the abnormal resources in a virtual scene, wherein the abnormal resources are different from the resources different from the abnormal resources in the presentation mode.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the resource processing method in the virtual scene according to the embodiment of the application.
Embodiments of the present application provide a computer readable storage medium storing executable instructions, where the executable instructions are stored, which when executed by a processor, cause the processor to perform a method provided by the embodiments of the present application, for example, a resource processing method in a virtual scenario as shown in fig. 5A, 5B, 5C, and 5D.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, such as in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or distributed across multiple sites and interconnected by a communication network.
The above is merely an example of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims (18)
1. A method for processing resources in a virtual scene, the method comprising:
Responding to the strategy setting operation received in the resource processing interface, and acquiring an inspection strategy set for the virtual scene; the resource processing interface comprises a plurality of screening conditions, and the checking strategy comprises names of attributes to be checked and attribute value conditions corresponding to the attributes to be checked;
Taking resources with the attribute value updating frequency smaller than a frequency threshold value in the virtual scene as white list resources;
mapping the attribute to be checked of the resource in the virtual scene into a callable object according to the name of the attribute to be checked, and obtaining an attribute value of the resource corresponding to the attribute to be checked by calling the callable object corresponding to the attribute to be checked, wherein the resource comprises a resource successfully matched with the selected screening condition in the multiple screening conditions or a resource different from the whitelist resource;
Matching the attribute value of the attribute to be checked corresponding to the resource with the attribute value condition corresponding to the attribute to be checked, and determining the abnormal resource in the virtual scene according to the obtained matching result;
and updating the resource processing interface according to the abnormal resources.
2. The method of claim 1, wherein the inspection policy further includes a name of an attribute to be screened, and an attribute value condition corresponding to the attribute to be screened;
before mapping the attribute to be checked of the resource in the virtual scene into the callable object according to the name of the attribute to be checked, the method further comprises:
mapping the attribute to be screened of the resource in the virtual scene into a callable object according to the name of the attribute to be screened, and obtaining an attribute value of the resource corresponding to the attribute to be screened by calling the callable object corresponding to the attribute to be screened;
Matching the attribute value of the attribute to be screened corresponding to the resource with the attribute value condition corresponding to the attribute to be screened, and determining the resource to be checked in the virtual scene according to the obtained matching result;
Wherein a plurality of the resources to be inspected are used for being inspected to include abnormal resources.
3. The method of claim 2, wherein the number of inspection strategies comprises a plurality; after the obtaining of the inspection policy set for the virtual scene, the method further includes:
traversing a plurality of said inspection policies; the traversed checking strategy is used for determining resources to be checked in the virtual scene;
after determining the resource to be checked in the virtual scene according to the obtained matching result, the method further comprises:
and when the number of the resources to be checked determined according to the traversed checking strategy is zero, continuing to traverse the next checking strategy.
4. The method according to claim 2, wherein the determining the resource to be inspected in the virtual scene according to the obtained matching result comprises:
the following is performed for each resource in the virtual scene:
When the matching result of the resource corresponding to the attribute to be screened is successful, the resource is used as the resource to be checked;
and when the matching result of the resource corresponding to the attribute to be screened is that the matching fails, ignoring the resource.
5. The method of claim 1, wherein the policy setting operation comprises a select operation and a condition setting operation;
The responding to the policy setting operation received in the resource processing interface, obtaining the checking policy set for the virtual scene comprises the following steps:
Presenting a plurality of attributes in the resource processing interface;
Responding to the selected operation aiming at the multiple attributes, and taking the name of the selected attribute as the name of the attribute to be checked;
And acquiring an attribute value condition set for the attribute to be inspected in response to a condition setting operation for the attribute to be inspected.
6. The method of claim 5, wherein said presenting a plurality of attributes in said resource processing interface comprises:
Presenting a plurality of screening conditions in the resource processing interface;
wherein the screening condition comprises at least one of resource types and modules to which the resources belong; the virtual scene comprises a plurality of modules, and each module comprises a plurality of resources;
In response to a selected operation for the plurality of screening conditions, a plurality of attributes of the resource that successfully matches the selected screening condition are presented.
7. The method of claim 6, wherein mapping the property to be inspected of the resource in the virtual scene as a callable object according to the name of the property to be inspected, comprises:
and mapping the attribute to be checked of the resource which is positioned in the virtual scene and successfully matched with the selected screening condition into a callable object according to the name of the attribute to be checked.
8. The method according to any one of claims 1 to 7, wherein determining an abnormal resource in the virtual scene according to the obtained matching result comprises:
the following is performed for each resource in the virtual scene:
When the matching result of the resource corresponding to the attribute to be checked is successful, ignoring the resource;
and when the matching result of the resource corresponding to the attribute to be checked is that the matching fails, taking the resource as an abnormal resource.
9. The method of claim 8, wherein updating the resource handling interface based on the abnormal resource comprises:
Determining the degree of difference between the attribute value of the attribute to be inspected corresponding to the abnormal resource and the attribute value condition corresponding to the attribute to be inspected;
Determining a risk level corresponding to the abnormal resource according to the difference degree;
And presenting a plurality of abnormal resources in the resource processing interface, wherein the abnormal resources corresponding to different risk levels are presented in different modes.
10. The method of claim 8, wherein updating the resource handling interface based on the abnormal resource comprises:
Presenting the abnormal resource and an abnormal repair option of the abnormal resource in the resource processing interface;
And responding to the triggering operation aiming at the abnormal repair option, and updating the attribute value of the abnormal resource corresponding to the attribute to be checked so as to enable the updated attribute value to be successfully matched with the attribute value condition corresponding to the attribute to be checked.
11. The method according to any one of claims 1 to 7, wherein the number of inspection strategies comprises a plurality, and each of the inspection strategies corresponds to a risk level;
after the obtaining of the inspection policy set for the virtual scene, the method further includes:
Traversing a plurality of said inspection policies; the traversed checking strategy is used for determining abnormal resources in the virtual scene;
the updating the resource processing interface according to the abnormal resource comprises the following steps:
Presenting a plurality of abnormal resources in the resource processing interface, wherein the abnormal resources corresponding to different risk levels are presented in different modes;
the risk level corresponding to the abnormal resource is a risk level corresponding to an inspection strategy for determining the abnormal resource.
12. The method according to any one of claims 1 to 7, wherein before mapping the property to be inspected of a resource in the virtual scene as a callable object according to the name of the property to be inspected, the method further comprises:
Multiplexing the attribute of the parent resource into the child resource in response to an attribute multiplexing operation for any one of the resource types in the virtual scene;
wherein, the father resource is a resource successfully matched with any resource type in the virtual scene; the child resource is a resource in the virtual scene that is different from the parent resource.
13. The method according to any one of claims 1 to 7, wherein after the obtaining of the inspection policy set for the virtual scene, the method further comprises:
In response to a policy multiplexing operation for any one attribute in the virtual scene, replacing the name of the attribute to be checked in the checking policy with the name of the any one attribute, and
And taking the attribute value condition corresponding to the attribute to be checked as the attribute value condition of any one attribute to obtain a new checking strategy.
14. The method according to any one of claims 1 to 7, wherein mapping the property to be inspected of the resource in the virtual scene as a callable object according to the name of the property to be inspected comprises:
and mapping the attribute to be checked of the resource which is positioned in the virtual scene and is different from the white list resource into a callable object according to the name of the attribute to be checked.
15. The method of any of claims 1 to 7, wherein the updating the resource handling interface according to the abnormal resource comprises:
And presenting the abnormal resources and the resources which are different from the abnormal resources in the virtual scene in the resource processing interface, wherein the abnormal resources and the resources which are different from the abnormal resources are presented in different modes.
16. A resource processing apparatus in a virtual scene, the apparatus comprising:
the acquisition module is used for responding to the strategy setting operation received in the resource processing interface and acquiring an inspection strategy set for the virtual scene; the resource processing interface comprises a plurality of screening conditions, and the checking strategy comprises names of attributes to be checked and attribute value conditions corresponding to the attributes to be checked;
The mapping module is used for taking resources with the attribute value updating frequency smaller than a frequency threshold value in the virtual scene as white list resources; mapping the attribute to be checked of the resource in the virtual scene into a callable object according to the name of the attribute to be checked, and obtaining an attribute value of the resource corresponding to the attribute to be checked by calling the callable object corresponding to the attribute to be checked, wherein the resource comprises a resource successfully matched with the selected screening condition in the multiple screening conditions or a resource different from the whitelist resource;
The matching module is used for carrying out matching processing on the attribute value of the attribute to be checked corresponding to the resource and the attribute value condition corresponding to the attribute to be checked, and determining abnormal resources in the virtual scene according to the obtained matching result;
and the updating module is used for updating the resource processing interface according to the abnormal resources.
17. An electronic device, comprising:
A memory for storing executable instructions;
A processor for implementing the method for processing resources in a virtual scene according to any one of claims 1 to 15 when executing executable instructions stored in said memory.
18. A computer readable storage medium storing executable instructions for implementing the resource handling method in a virtual scenario according to any one of claims 1 to 15 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110170979.7A CN112783660B (en) | 2021-02-08 | 2021-02-08 | Resource processing method and device in virtual scene and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110170979.7A CN112783660B (en) | 2021-02-08 | 2021-02-08 | Resource processing method and device in virtual scene and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112783660A CN112783660A (en) | 2021-05-11 |
CN112783660B true CN112783660B (en) | 2024-05-07 |
Family
ID=75761251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110170979.7A Active CN112783660B (en) | 2021-02-08 | 2021-02-08 | Resource processing method and device in virtual scene and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112783660B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113191124B (en) * | 2021-05-20 | 2023-03-21 | 上海曼恒数字技术股份有限公司 | Runtime editing method and system based on 3D engine |
CN114356712B (en) * | 2022-01-04 | 2024-07-19 | 腾讯科技(成都)有限公司 | Data processing method, apparatus, device, readable storage medium, and program product |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572454A (en) * | 2014-12-25 | 2015-04-29 | 广东欧珀移动通信有限公司 | Method and device for positioning resource |
CN104572450A (en) * | 2014-12-25 | 2015-04-29 | 广东欧珀移动通信有限公司 | Method and device for detecting resource allocation |
CN109544267A (en) * | 2018-10-19 | 2019-03-29 | 中国平安人寿保险股份有限公司 | Resource acquiring method, device, computer equipment and storage medium |
CN110837420A (en) * | 2019-11-12 | 2020-02-25 | Oppo广东移动通信有限公司 | Resource scheduling method, device, terminal and storage medium |
CN112199093A (en) * | 2020-10-15 | 2021-01-08 | 腾讯科技(深圳)有限公司 | Resource checking method, device, equipment and computer readable storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3563215A4 (en) * | 2016-12-29 | 2020-08-05 | Magic Leap, Inc. | Automatic control of wearable display device based on external conditions |
CN109144610B (en) * | 2018-08-31 | 2020-11-10 | 腾讯科技(深圳)有限公司 | Audio playing method and device, electronic device and computer readable storage medium |
-
2021
- 2021-02-08 CN CN202110170979.7A patent/CN112783660B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572454A (en) * | 2014-12-25 | 2015-04-29 | 广东欧珀移动通信有限公司 | Method and device for positioning resource |
CN104572450A (en) * | 2014-12-25 | 2015-04-29 | 广东欧珀移动通信有限公司 | Method and device for detecting resource allocation |
CN109544267A (en) * | 2018-10-19 | 2019-03-29 | 中国平安人寿保险股份有限公司 | Resource acquiring method, device, computer equipment and storage medium |
CN110837420A (en) * | 2019-11-12 | 2020-02-25 | Oppo广东移动通信有限公司 | Resource scheduling method, device, terminal and storage medium |
CN112199093A (en) * | 2020-10-15 | 2021-01-08 | 腾讯科技(深圳)有限公司 | Resource checking method, device, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112783660A (en) | 2021-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101553771B (en) | Rendering hypertext markup language content | |
CN114064024B (en) | Method, apparatus, device, storage medium and program product for developing micro-application | |
CN112783660B (en) | Resource processing method and device in virtual scene and electronic equipment | |
CN110244984A (en) | Applied program processing method, device, storage medium and computer equipment | |
CN110442510B (en) | Page attribute acquisition method and device, computer equipment and storage medium | |
CN112691381B (en) | Rendering method, device and equipment of virtual scene and computer readable storage medium | |
CN112947969B (en) | Page off-screen rendering method, device, equipment and readable medium | |
CN111324381B (en) | Development system, development method, development apparatus, computer device, and storage medium | |
CN109045694B (en) | Virtual scene display method, device, terminal and storage medium | |
CN112068923B (en) | Interface updating method and device | |
CN113868126A (en) | Application debugging method, device and storage medium of equipment | |
CN115309516A (en) | Application life cycle detection method and device and computer equipment | |
CN111367518A (en) | Page layout method and device, computing equipment and computer storage medium | |
CN113018870A (en) | Data processing method and device and computer readable storage medium | |
CN114494024B (en) | Image rendering method, device and equipment and storage medium | |
CN111857878A (en) | Skeleton screen page generation method and device, electronic equipment and storage medium | |
CN113971191A (en) | Data import method and device and computer readable storage medium | |
CN114065076A (en) | Unity-based visualization method, system, device and storage medium | |
CN106886435A (en) | The loading method and device of widget | |
CN112717416B (en) | Resource processing method and device in virtual scene and electronic equipment | |
CN113157455B (en) | Memory management method, memory management device, electronic equipment and computer readable storage medium | |
CN115827457A (en) | Browser compatibility testing method and related equipment | |
CN113192173B (en) | Image processing method and device of three-dimensional scene and electronic equipment | |
CN118170284B (en) | Window rendering method, device, equipment and medium | |
US20240033625A1 (en) | Rendering method and apparatus for virtual scene, electronic device, computer-readable storage medium, and computer program product |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40043479 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |